Repository navigation
sync: a peer that pulled says what it now holds, so the base is recorded at once - #51
Open
ChakraFusion wants to merge 1 commit into
Open
ChakraFusion wants to merge 1 commit into
ChakraFusion wants to merge 1 commit into
Conversation
…ded at once After a pure pull the puller records the agreed base; the device it pulled from recorded the same only when a later fetch of the puller's save found it unchanged. A puller that edited again first (quick turns, a game saving right after a sync) left that device with a stale base, and its next sync read both sides as changed: a false conflict, after which it took nothing (upstream CI: TestSoak_ManyAlternatingRoundsNeverConflict, Windows, relay). The puller now sends an "agreed" report with the hash it holds; the other side records it as the base when it is exactly what it handed over (its push record), and ignores it otherwise. Older peers ignore the report. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@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 branch has not been deployed
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.
Follow-up to my comment on #49 (the
TestSoak_ManyAlternatingRoundsNeverConflictfailure).After a pure pull, the puller records the agreed base. The device it pulled from records the same only when a later fetch of the puller's save finds it unchanged (
RefreshLineage). If the puller edits again first (quick turns, or a game saving right after a sync), that device keeps a stale base. Its next sync then reads both sides as changed: a false conflict, after which it takes nothing more from that peer.Fix: after a pure pull, the puller sends a small
agreedsync-event with the manifest hash it now holds. The other device records it as the base only if it is exactly what it handed over (its push record), and ignores it otherwise. Peers that predate this ignore the unknown event type.Tests:
TestAgreedReport_WithoutItTheNextSyncConflictsreproduces the false conflict deterministically.…ThePeersNextEditIsTakenWithoutAConflict: with the report, the next edit is simply taken.…AnotherStateIsIgnored: a report of any other state moves nothing.TestQuickTurns_NoFalseConflict: quick alternating turns over the relay.TestSync_PullNewRemoteFilenow expectsagreedaftersync-complete.🤖 Generated with Claude Code