Repository navigation
sync: a peer that pulled says what it now holds, so the base is recorded at once - #51
ChakraFusion wants to merge 2 commits into
Conversation
|
@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. |
|
The failing job is |
…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. Like "sync-complete" since Liquid-co#80, the report is answered at once and sent again until it is answered (carriesState), with the same reportId; a repeat is recorded once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Liquid-co#57 removes logOnFailure, since every e2e test daemon now prints its log when its test fails. Without this, the test stops compiling once Liquid-co#57 is merged; before that, it only loses the log it asked for itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0743bab to
02226b6
Compare
|
Rebased onto |
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