Skip to content

fix(core-sync): Off and back on the same account no longer asks about another account - #4827

Merged
datlechin merged 5 commits into
mainfrom
fix/off-and-back-same-account
Dec 2, 2026
Merged

datlechin merged 5 commits into
mainfrom
fix/off-and-back-same-account

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • A state file change and its anchor no longer split when the caller is dropped. A commit, an open, a delete and a move to a new row run to their end as their own task, holding the file's lock.
  • Every close waits for a change still landing (StateFiles::settled, StateStore::settled): TablePro Sync's, iCloud's and the host's, a second close and one after a dropped close included. The next service starts on the file at once, and a quit cuts none.
  • A policy read (0055) a change was checked under goes into the detached change: StateTxn::commit_holding and StateFiles::delete_holding at every move fence, and RecordAdapter::apply_holding plus the store writes of Team Library's publish, import and Keep Mine.
  • Cause of E2E F2: after the Off to TablePro Sync upload, the app closed the old service while its scheduler's pass was inside a commit. The abort dropped the commit after the device store took the anchor's pending entry and before SQLite committed. The next open read that as a restored file, refilled it and set the account choice: "Signed In to Another Account", personal changes held until Move My Data.
  • The same split came from a call the app cancels, a service Windows drops, iCloud's close (same prompt), the open of a new file (the device then needed approval again) and a delete.
  • Mac and Windows get it through the core. No app change.

Test plan

  • state_integrity::dropped: a commit, a new file's open, a delete and a move to a new row, each dropped while the device store holds one of its writes. On main the next open finds Refill (and Unanchored after the open and the delete, wrong_identity after the move). Here it opens fresh with the change landed. Also settled waits for such a change, and a dropped commit keeps what it was checked under until it lands.
  • cloudkit::close: a close waits for the open its dropped pass left, and a close after a dropped close still waits for a commit.
  • adapters::team_library: a Team Library write keeps its policy read inside the store's write.
  • ffi sync::tests::a_service_closed_during_a_commit_leaves_the_next_one_nothing_to_ask: the F2 sequence on one Mac. On main the TablePro Sync service answers a plan for the account choice. Here sync.not_allowed, phase not NewIdentity, and it starts without waiting for the file.
  • cargo nextest: tablepro-sync, tablepro-sync-testing, tablepro-sync-host (1417), tablepro-ffi sync (74). fmt, clippy -D warnings.

@datlechin
datlechin merged commit 05f10dc into main Dec 2, 2026
34 checks passed
@datlechin
datlechin deleted the fix/off-and-back-same-account branch December 2, 2026 05:58
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