Skip to content

fix(core-sync): a device approved after its account made a team key holds that key at once, and starts no key over before it read who holds it - #4842

Merged
datlechin merged 2 commits into
mainfrom
fix/core-sync-approved-device-team-key
Dec 3, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/core-sync-approved-device-team-key

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • A device approved after its account made a team's key now holds that key at once (E2E W12). Before, it held the team's version with no holders until a new key object came from the team or the state file refilled: team connections asked for the password, Team keys said "No one on this team holds the current team key" and offered Start over, and its own account showed as waiting for confirmation.
  • Cause: the approval's merge (keys/approval/confirm.rs, merge_approval) imports a team version the approver holds with no holders, and the device judged a team only when a pull brought that team a key object. The team's version record and wraps had come in the pulls while the device waited, so nothing judged them again.
  • The merge's commit now judges every team on the key objects the device already holds, as accepting a pin and the end of a rebuild do.
  • Each caught-up team pull judges a version with no holders read, so a device an earlier build left that way (Mac 0.89.0 included) reads them at its next pass.
  • A restart from a device that has not read who holds the version is refused with sync.not_allowed. Before, it went through and replaced a key the account held.
  • TeamKeys and the FFI's TeamKeysInfo gain holders_known. Windows shows "This computer is still reading the team's keys from the server" instead of Start over while it is false. C# bindings regenerated. The Mac does not read it yet and still offers Start over in that window, which the core now refuses.
  • The relaunch that seemed to fix it on the rig was the F2 refill, which pulled the team again from a snapshot. The 429 on the team pull at 03:41 came before the approval and plays no part.
  • New core ADR 0118, amending 0056; 0056's Status line and the index rows name it.

Test plan

  • Fail on main, pass here:
    • tests/core_engine/approval.rs, a_device_approved_after_its_account_made_a_team_key_holds_that_key_at_once: on main holder: false, the owner AwaitingConfirmation, the rig's state.
    • tests/core_engine/approval.rs, a_team_version_left_with_no_holders_read_is_read_at_the_next_pass.
    • tests/device_flows/team_join.rs, a_device_that_has_not_read_who_holds_a_team_key_starts_none_over: on main the restart returns Ok(()).
    • TeamKeysTests.AnOwnerWhoseComputerHasNotReadWhoHoldsTheKeyIsOfferedNoRestart.
  • verify.sh --platform windows --jobs 4 core: PASS for tablepro-sync (1327), tablepro-sync-testing (105), tablepro-sync-host (16), tablepro-ffi (555). bindings: PASS after regenerating. test TablePro.App.Model.Tests: PASS (1533).
  • cargo clippy --locked -p tablepro-sync -p tablepro-sync-testing -p tablepro-sync-host -p tablepro-ffi --all-targets -- -D warnings and cargo fmt --check: clean.
  • Codex, codex review --base origin/main and a security pass with codex exec -s read-only: no findings.

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