Repository navigation
Harden the v2 sync engine: list merge policies, conditional deletes, shadow from reply, returning users, clock skew - #52
Merged
Conversation
…n only while positions line up); otherwise the server's list is kept and the local one set aside
… both sides touch overlapping indices, so a shifted diff (a remove plus an insert, or a reorder) can no longer read as agreement; also treat an identical result at a colliding root list as clean, not a conflict
…when both sides changed it and ended up different, since a disjoint-looking edit may really be retargeted at the other side's twin
…ic and checks no element is lost or duplicated at a rebase
…res list conflicts to be whole, and checks element order
… another device supersedes it, and edits made before the delete are kept
…a newer version superseded
…ient had not seen
…lient sends in a fixture the server shares
…as sent, instead of re-uploading forever
…a parked document can still be deleted
…or; a refused upload clears its sent marks
…ently revive an element another device removed
… instead of being re-sent
…or fetches the server copy first, and a newer version supersedes it
…the server copy first
…eeps local edits aside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardening pass on the v2 sync engine, closing the design-review findings on lists, deletes, shadows, returning users and clock skew (DEV-1150).
Atomic,Appenddefault;Fullreserved and refused). List conflicts are always whole-list; append on one side merges with same-length edits on the other; overlapping same-length edits, both-side appends, inserts/removes and repeated values conflict.base_hash). A newer version supersedes a pending delete (DeleteSuperseded), keeping pre-delete edits as a kept copy (delete_superseded) only when edited. A no-shadow delete fetches the server copy first unless it is a never-sent create (incl. migrated docs). A delete the server refuses restores the server version (delete_refusedcopy when edited). A pending delete goes out behind parked rows; a refused delete parks itself.SyncError{diverged}. Shared 59-case JSON Patch fixture with the server.own's first changes answer. Refused uploads keep their sent marks.clock_skewjoin is re-signed once with the server's clock; the offset is kept for later reconnects.Tests: lib 570, wire 15; property model covers lists on both sides under both policies at 20k seeds.
Closes #3