Repository navigation
Sync: oversized preferences are left out instead of failing every round; CLI explains keep and keep-both - #360
Merged
Merged
Conversation
…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>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Two small follow-ups on sync, on top of #358.
Oversized general preferences
Preferences over
CLIENT_PREFS_MAXcannot be written on this device. They used to makewrite_prefsrefuse 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:
SyncView.notices(new,Vec<Msg>) carriessync.prefs_too_large(new code). It is not an error and does not count toward unreachable.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. Forr, 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 nofailing_since_ms,notices[0].code == "sync.prefs_too_large", and the rest is applied.cargo test --workspace3846 passed, 0 failed;cargo clippy --workspace --all-targets -D warningsclean;cargo fmt --checkclean;scripts/smoke.sh84 passed, 0 failed.🤖 Generated with Claude Code