Repository navigation
fix(sync): a removal's owed team rotations keep its marks, wait for stopped teams and outlive Sign Out - #4774
Merged
Merged
Conversation
…topped teams and outlive Sign Out
…-removal-marks # Conflicts: # core/docs/decisions/0054-one-sync-engine-in-the-core-for-tablepro-sync-and-icloud.md # core/docs/decisions/0056-end-to-end-keys-per-account-and-device.md # core/docs/decisions/README.md
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
An account rotation records the teams the account held when it began (
TeamStepsformat 5).A team step is done only when one of these holds:
avon, and no marked member holds it, counting the holders the device stored for that version;A missing or stopped row waits.
A replace, removal or recovery carries what earlier rotations still owe, so a replace that ends a removal's flow keeps its marks.
A team rotation written by a step, or by Rotate by hand, leaves out every member a flow of this device still owes the team. A flow that a later one ended writes nothing back.
Sign Out and the 0081 takeover keep each flow's owed steps as a new
key_pendingkind,owed/{av}, holding only marks and teams. The next device approved on the file runs them.move_to_rowlets a file move whilekey_pendingholds only those rows.A recovery on a file with no anchor drops its untrusted key rows in the commit that adopts it, and settles the anchor there before switching to the device keys it drew. Only the device store tells a recovery.
A device left out after its own rotation applied no longer adopts that rotation on every pass.
A waiting team step asks for no pass. A network failure in a step ends the resume with that error. The pass pushes the records, then ends with the failure the scheduler backs off on, keeping the longest
Retry-After.Accepting a member's new key judges every team again in the same commit.
ADR 0100, plus the status lines of 0054, 0056 and 0081 and the index.
Tests changed on purpose:
rotation::reviewan_empty_state_marks_no_one_and_every_state_round_trips: builds format 3 and 4 states for the format 5 layout.device_flows::rotation::a_recovery_of_a_device_that_held_its_keys_cut_off_before_its_candidates_drops_what_it_drew: cut off after 2 commits, since an unanchored file now clears its key rows at adoption.Test plan
New tests, each failing on main:
device_flows::owed_steps(11 tests):device_flows::recovery_cut_off: a recovery the server took is never left locked, whichever commit was cut off.device_flows::key_change: accepting a new key takes the restart wrapped under it.account_keys::owed_steps: the takeover keeps the removed row's owed steps.engine::keys: a network failure in a key flow ends the pass after the records went up; a push failure keeps the flow's longerRetry-After.Local, on the merged head:
cargo test --locked -p tablepro-sync -p tablepro-sync-testing -p tablepro-ffi: every target passes on macOS.tablepro-linux-devcontainer.cargo clippy --locked -p tablepro-sync -p tablepro-sync-testing -p tablepro-ffi --all-targets -- -D warnings: clean.cargo fmt --check: clean.verify.sh --platform linux test tablepro-synccannot run on macOS:meson setupneeds libseccomp. The container run above stands in for it.