Open
Description
If you follow the reproduction steps at Automattic/simplenote-android#560 (comment) in Simplenote, you'll get data loss for the last line that you added.
I think this is an issue with the way we are transforming a diff to apply local and remote changes at once to an object here: https://github.com/Simperium/simperium-android/blob/develop/Simperium/src/main/java/com/simperium/client/Bucket.java#L966
I tried a test where I added the text One
and Two
while offline around a paragraph that was deleted remotely. The incoming
patch was:
{"content":{"o":"d","v":"=683\t-815\t+DELETED!"},"modificationDate":{"o":"r","v":1.537995756631E9}}
The local
patch was:
{"content":{"o":"d","v":"=685\t+e%0A%0AOn\t=813\t+%0A%0ATwo"},"modificationDate":{"o":"r","v":1537995767}}
But the resulting transformed diff was:
{"modificationDate":{"o":"r","v":1537995767}}