Skip to content

fix(core-sync): close waits for Team Library's store writes, and Keep Mine checks the policy before a kept password goes back - #4828

Merged
datlechin merged 2 commits into
mainfrom
fix/team-library-close-and-keep-mine
Dec 2, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/team-library-close-and-keep-mine

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Closing TablePro Sync's engine waits for a Team Library store write that a dropped pass or call left running. TeamLibraryStore::in_flight is taken before a write goes to a blocking thread and moved into it, and TeamLibraryStore::settled waits for them. Every write takes it: the engine's store_write and the adapters' identity, apply and pulled_writers. Reads do not. ServiceSync::idle, which close calls, waits on it after the state file.
  • Keep Mine on a team conflict takes the policy read (0055) before it puts a kept password back, and carries it into every write the choice makes: the restore, the envelopes it reverts and their refused rows, the resolve and the local write after it. A server the policy forbids refuses Keep Mine with the store as it was, and a Keep Mine dropped halfway keeps the read until its write lands.
  • The two tests fix(core-sync): Off and back on the same account no longer asks about another account #4827 added that poll a wait once now fail their assertion instead of a second poll when the wait returns at once.
  • Follow-up to fix(core-sync): Off and back on the same account no longer asks about another account #4827 (its Codex adversarial round 4). No app change, no format change.

Test plan

  • team_library::close::idle_waits_for_a_store_write_a_dropped_publish_left_running: on main idle returns while the write runs.
  • adapters::team_library::every_adapter_write_counts_as_in_flight: each adapter write waits behind a close that waits for a running write.
  • core_engine::team_secrets::keep_mine_on_a_server_the_policy_forbids_puts_no_kept_password_back: on main the kept password is back in the store after the refusal.
  • core_engine::team_secrets::a_keep_mine_dropped_during_its_restore_holds_the_policy_read_until_the_password_is_back: without the read in the restore's write, the policy change lands first.
  • storage team_library::tests::settled_waits_for_a_call_still_in_flight.
  • cargo nextest: tablepro-storage (team_library), tablepro-sync, tablepro-sync-testing, tablepro-sync-host (1421), tablepro-ffi sync (74). fmt, clippy -D warnings.

… Mine takes the policy read before a kept password goes back
…e-and-keep-mine

# Conflicts:
#	core/crates/sync/src/adapters/team_library.rs
#	core/crates/sync/src/service/mod.rs
@datlechin
datlechin merged commit 8f66892 into main Dec 2, 2026
33 of 34 checks passed
@datlechin
datlechin deleted the fix/team-library-close-and-keep-mine branch December 2, 2026 07:18
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