Skip to content

Sync: oversized preferences are left out instead of failing every round; CLI explains keep and keep-both - #360

Merged
fylorn merged 1 commit into
feat/sync-backupfrom
feat/sync-fixes-3
Oct 19, 2026
Merged

fylorn merged 1 commit into
feat/sync-backupfrom
feat/sync-fixes-3

Conversation

@fylorn

@fylorn fylorn commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Two small follow-ups on sync, on top of #358.

Oversized general preferences

Preferences over CLIENT_PREFS_MAX cannot be written on this device. They used to make write_prefs refuse the write, which failed the whole apply on every round. The view stayed "idle" with an error and, after two hours, reported the location as unreachable.

Now:

  • When the sync data's preferences are too large they are held: this device keeps its own, uploaded versions keep the sync data's (this device's are never pushed over them), and everything else syncs. The same applies when the merged preferences come out too large, and on join.
  • SyncView.notices (new, Vec<Msg>) carries sync.prefs_too_large (new code). It is not an error and does not count toward unreachable.
  • Once the sync data's preferences fit again and this device's did not change meanwhile, they land as synced. They do not count as a local edit and do not cause a conflict.
  • The control plane's apply also skips oversized preferences instead of failing, as a guard.

twcore sync enable

"keep this device's version" (k) and "keep both" (r) now say that this device's version is uploaded with the join and replaces the item of that name on the other devices. For r, the other devices also get the renamed copy.

Tests

  • tw-sync/tests/regressions.rs: the test host now stores preferences and refuses oversized ones the way the control plane does. The new test covers: the rest applies, the notice shows (also on the shortcut round), uploads keep the sync data's preferences, and smaller preferences land later without a conflict.
  • tw-control/tests/sync_regressions.rs: through the endpoints, the state is idle, there is no error and no failing_since_ms, notices[0].code == "sync.prefs_too_large", and the rest is applied.
  • Local: cargo test --workspace 3846 passed, 0 failed; cargo clippy --workspace --all-targets -D warnings clean; cargo fmt --check clean; scripts/smoke.sh 84 passed, 0 failed.

🤖 Generated with Claude Code

…nd; CLI explains keep and keep-both

Preferences larger than the limit (they cannot be written here) used to fail
the whole apply, every round, until the state read as unreachable. Now:
- When the sync data's general preferences are too large, they are held:
  this device keeps its own, the uploaded versions keep the sync data's
  (this device's are never pushed over them), and everything else syncs.
  The same applies when the merged preferences come out too large, and on
  join.
- SyncView.notices carries sync.prefs_too_large. It is not an error and does
  not count toward unreachable.
- Once the sync data's preferences fit again and this device's did not
  change meanwhile, they land as synced instead of looking like a local edit.
- The control plane's apply skips oversized preferences rather than failing.

twcore sync enable: "keep this device's version" and "keep both" now say
that this device's version is uploaded with the join and replaces the item
of that name on the other devices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 0a06fe7 into feat/sync-backup Oct 19, 2026
7 checks passed
@fylorn
fylorn deleted the feat/sync-fixes-3 branch October 19, 2026 12:23
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant