Skip to content

fix(core-sync): a profile deleted on another device reaches the connections that used it where the Core keeps profile secrets - #4777

Merged
datlechin merged 2 commits into
mainfrom
lane/g1-profile-handover
Nov 30, 2026
Merged

datlechin merged 2 commits into
mainfrom
lane/g1-profile-handover

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Where the Core keeps the profiles' secrets itself (Windows, core ADR 0088), a profile deletion a pull wrote now reaches the connections still linked to it, as the Mac's ConnectionStorage.handOverPulledProfileDeletions does (core ADR 0107 left those secrets for the app).
  • tablepro-storage: once a host asks (keep_pulled_profile_deletions), the store keeps each profile a synced write deletes, at its value at that write; the person's own writes, a rebuild and a reset keep none. plan_profile_handover_blocking and finish_profile_handover_blocking plan the handover under the store's lock and write it only if the file is unchanged since the plan.
  • tablepro-ffi: the sync service starts the handover when the app passes no HostSyncedSecrets and the Core has its own. Under the library's lock it copies the profile's secrets to each linked connection, writes the connections, then deletes the profile's items; a refused write or a failed copy puts back what the copy replaced and waits for the next store write.
  • SSH: the connection takes the profile's settings and is marked as unlinked here. Credential: the connection takes the user, the stored password, or the reference or local password source; Ask and pgpass delete a stale connection password. A secret the profile lacks is removed from the connection, and the items stay while the store holds a connection this build cannot read.
  • Core ADR 0111, amending 0088 and 0107; status lines and the index. Windows ADR 0029 names it.
  • SyncService::open moves the CloudKit policy wrap into OpenParts::fence_cloudkit, keeping it under the 100-line lint.

Test plan

  • Fail on main, pass here: a_pulled_ssh_profile_deletion_hands_its_tunnel_and_secrets_to_a_linked_connection_where_the_core_keeps_them and a_pulled_credential_profile_deletion_hands_its_user_and_password_to_a_linked_connection_where_the_core_keeps_them (both time out with the handover off).
  • tablepro-storage connections::handover tests: last value kept, nothing kept before a host asks or for a rebuild, a profile brought back, a failed copy, a file changed since the plan, unreadable connections, a connection both deleted profiles linked.
  • On the Mac: tablepro-storage connections tests 240/240, tablepro-ffi sync tests 88/88 (the secrets tests repeated), clippy clean on tablepro-ffi, tablepro-storage and tablepro-sync (all targets), verify.sh --platform windows build PASS, Windows model tests 1499/1499.
  • On tp-win (Windows Arm64): the credential_manager, profile_secrets and handover tests, 25/25.
  • Codex review: 6 rounds; the design moved from a store watch to store-kept deletions and plan and finish; the last 2 rounds clean.

…s and secrets to the connections still linked to it where the Core keeps profile secrets
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