Skip to content

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
Liquid-co:dev-publicfrom
ChakraFusion:pr/agreed-report
Open

ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/agreed-report

Conversation

@ChakraFusion

Copy link
Copy Markdown

Follow-up to my comment on #49 (the TestSoak_ManyAlternatingRoundsNeverConflict failure).

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 agreed sync-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_WithoutItTheNextSyncConflicts reproduces the false conflict deterministically.
  • …ThePeersNextEditIsTakenWithoutAConflict: with the report, the next edit is simply taken.
  • …AnotherStateIsIgnored: a report of any other state moves nothing.
  • e2e TestQuickTurns_NoFalseConflict: quick alternating turns over the relay.
  • TestSync_PullNewRemoteFile now expects agreed after sync-complete.

🤖 Generated with Claude Code

…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]>
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant