Skip to content

Content loss after merge of local and remote change #68

Description

@roundhill

Refs: Automattic/simplenote-android#560 (comment)

Merging two diffs with an object doesn't appear to be working correctly. Here's some sample data, in this case the text After is deleted.

remote change:

{"content":{"o":"d","v":"=16\t-7\t+placed"},"modificationDate":{"o":"r","v":1541173714}}

localModifications:

{"content":{"o":"d","v":"=14\t+Before%0A\t=9\t+%0AAfter"},"modificationDate":{"o":"r","v":1541116216}}

transformed:

{"modificationDate":{"o":"r","v":1541116216},"content":{"o":"d","v":"=14\t+Before%0A\t=8"}}

original object:

{"tags":[],"deleted":false,"shareURL":"","systemTags":["markdown"],"content":"Line 1\nLine 2\nRemove me","publishURL":"","modificationDate":1541116180,"creationDate":1541116168.779}

updated object:

{"tags":[],"deleted":false,"shareURL":"","systemTags":["markdown"],"content":"Line 1\nLine 2\nBefore\nReplaced","publishURL":"","modificationDate":1541116216,"creationDate":1541116168.779}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions