Repository navigation
syncengine: count any edit after the last sync as a change - #72
Merged
Merged
Conversation
Without a merge base, DetectConflict compares each side's latest mtime with the last-synced time. A 2 s clock-skew allowance was added to that time, so edits made on both devices within 2 s after a sync read as neither side having changed, and one replaced the other with no conflict raised. Any edit after the last sync now counts as a change. A conflict still needs both sides changed; one side alone wins as before. With a base recorded nothing changes. The allowance is dropped rather than moved before the sync: a pulled file keeps the sender's mtime, just before the stamp in a quick exchange, and counting that copy as a change made the other device's next edit a conflict (TestUntrackPropagatesAndRecovers and TestSwitch_TheSameGameUnderDifferentIDsSyncs fail that way). TestMultiRootScenario_EditsRightAfterASyncStillConflict stamps the two devices as synced, clears the location's base and edits both sides at once; it fails 3/3 without this (A="B-version" B="B-version"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Oct 15, 2026
ChakraFusion
pushed a commit
to ChakraFusion/OpenSave
that referenced
this pull request
Oct 16, 2026
Entries for Liquid-co#49, Liquid-co#70, Liquid-co#69, Liquid-co#72, Liquid-co#68 and Liquid-co#47, added at the end of the Fixed list so they do not touch Liquid-co#75's own entry. Liquid-co#57 is test-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
As agreed on #57: the narrow version of option 1.
Without a recorded merge base,
DetectConflictcompares each side's latest mtime with the last-synced time. A 2 s clock-skew allowance was added to that time. Edits made on both devices within 2 s after a sync therefore read as neither side having changed, and one replaced the other with no conflict raised.Now any edit after the last sync counts as a change:
Why the allowance is dropped rather than moved before the sync. I tried that first, so that the 2 s before the stamp would count as a change too. It broke
TestUntrackPropagatesAndRecoversandTestSwitch_TheSameGameUnderDifferentIDsSyncs(7 of 8 runs; 8 of 8 pass without it). A pulled file keeps the sender's mtime, which in a quick exchange is just before the stamp. The receiving device's untouched copy then counted as changed, so the sender's next edit became a conflict and nothing synced.Tests:
TestDetectConflict: the old "within tolerance does not count" case becomes three cases:TestMultiRootScenario_EditsRightAfterASyncStillConflict(e2e): stamps the two devices as synced, clears the location's base (as a lost report leaves it), and edits both sides at once.A="B-version" B="B-version".Trade-off: clocks are no longer given 2 s of slack. Suppose a device's clock is ahead and it holds an untouched file the other device wrote just before a sync. If the other device then edits before a base is recorded, that can be asked about as a conflict. This only applies while no base is recorded, and it is the "occasional extra prompt right after a sync" you said is the better failure.
Checks:
TestReportedWAN_AlternatingEditsMustNotConflict("B's edit never reached A"), the push loop in Two devices push to each other forever when a save returns to an earlier state (since #42) #71. That test syncs a main save folder with a merge base, which doesn't reach this code.🤖 Generated with Claude Code