Skip to content

fix(sync): an open editor clears a read password that no longer applies, and says why - #4843

Merged
datlechin merged 2 commits into
mainfrom
fix/editor-read-secret-moved-note
Dec 3, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/editor-read-secret-moved-note

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • When a pull or another window moves an open editor's connection or its SSH profile, or a secret of it lands, the editor clears each password, passphrase, TOTP secret or driver secret it read and shows "This connection changed outside this window. Enter it again." under the field. Before, the value stayed in the field while Test and Save treated it as missing (fix(sync): an open editor's read secrets go only where the library still points #4835, core ADR 0116).
  • A value the person typed stays. The note goes once the field holds a value.
  • A cleared field is no edit: the window has nothing new to save, and Save deletes the item only when the record no longer uses it (Ask Every Time, TOTP off, no client key, a type without the field, a linked profile).
  • The clear takes the paste undo actions with it, so Undo brings no read value back without its reading. A URL pasted later leaves a cleared field empty, so its Undo cannot bring the field back without the clear.
  • The check runs on every library, connection and profile change the editor hears, when the SSH profile sheet closes, and when Test starts. While that sheet is open it waits, so an edit or delete made in the sheet renews the readings first.
  • ConnectionStorage.readCoreWrites now announces a connection change when a secret landed with no record change; before, an open editor never heard of one.

After
After, dark
Before

Test plan

  • New: ConnectionEditorStoreSecretStateTests.profileMoveClearsTheReadPassword, profileMoveKeepsATypedPassword, typingRemovesTheNote, landingReadBackClearsTheReadPassword, connectionMoveClearsTheReadSSHSecrets, askEveryTimeAfterAClearDeletesTheStoredPassword, totpOffAfterAClearDeletesOnlyTheTOTPSecret, undoAfterAClearRestoresNoReadPassword, pasteLeavesAClearedFieldAlone, moveDuringTheProfileSheetWaitsForItToClose; SecretWritePlanTests.clearedFieldDeletesNothing, clearedFieldGoesWithItsPlace; CoreLibraryStoreTests.aLandedSecretAloneIsAnnounced.
  • Changed on purpose: testDropsAPasswordReadBeforeTheProfileMoved now expects the field empty after the move; it pinned the value staying.
  • verify.sh --jobs 4 build and lint on each changed Swift file pass; l10n passes.
  • verify.sh --jobs 4 test on every ConnectionForm suite plus CoreLibraryStoreTests, DialedSecretsTests, KeychainSyncedSecretsTests, SyncPassFollowerTests, SyncApprovalsModelTests, SyncApprovalReviewSheetTests, ConnectionLibraryStorageTests and ConnectionTimeoutSettingsTests: 546 of 546.
  • Shots: a hosted render of the editor before and after the linked SSH profile moved.

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