Skip to content

watcher: a watch stopped during its snapshot starts no sync - #58

Merged
Omar-VF merged 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/stopped-watch-no-sync
Oct 15, 2026
Merged

Omar-VF merged 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/stopped-watch-no-sync

Conversation

@ChakraFusion

Copy link
Copy Markdown

Found from the logs #57 printed for the TestMultiRootScenario_ALateReportDoesNotHideADivergence failure on Windows CI. Device B's log there: "the watcher for loclatereport did not stop within 5s and was abandoned", then "auto-snapshot created", then a sync with A, after the test had switched auto-sync off.

Cause: a snapshot can take longer than stopping waits for the watch (watchStopTimeout, 5 s). The watch was given up, but its handleChange ran on, finished the snapshot, and called OnChanged, which starts a sync. A game whose auto-sync had just been switched off was synced anyway; in the test, that sync's "in sync" report gave A a fresh last-synced time right before both devices edited.

Fix:

  • handleChange keeps the snapshot (it is the save as it changed) but doesn't call OnChanged once its watch was stopped.
  • The daemon's OnChanged doesn't start a sync for a game whose auto-sync is off. That also covers the catch-up check, which runs outside any one watch.

Test: TestAWatchStoppedDuringItsSnapshotAnnouncesNothing stops a watch while its snapshot is held mid-way. It fails without the change (the change is announced after the stop).

🤖 Generated with Claude Code

A snapshot can take longer than stopping waits for its watch
(watchStopTimeout, 5 s). The watch was given up, but its handleChange ran
on, finished the snapshot and called OnChanged, which syncs the game - a
game whose auto-sync had just been switched off.

Seen in the logs Liquid-co#57 printed for TestMultiRootScenario_ALateReportDoes
NotHideADivergence on Windows CI: "the watcher for loclatereport did not
stop within 5s and was abandoned", then "auto-snapshot created" and a sync
with the other device, whose "in sync" report gave it a fresh last-synced
time just before the test's edits.

- handleChange keeps the snapshot, which is the save as it changed, but
  announces nothing once its watch was stopped.
- The daemon's OnChanged starts no sync for a game whose auto-sync is off,
  which also covers the catch-up, run outside any one watch.

Test: TestAWatchStoppedDuringItsSnapshotAnnouncesNothing holds a snapshot
mid-way and stops the watch (fails without the change: the change is
announced after the stop).

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.

@Omar-VF
Omar-VF merged commit 92c9511 into Liquid-co:dev-public Oct 15, 2026
10 of 11 checks passed
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.

2 participants