Skip to content

fix(connections): cancel and explain foreign-app keychain prompts#1137

Merged
datlechin merged 7 commits into
mainfrom
fix/import-keychain-cancellation
May 9, 2026
Merged

fix(connections): cancel and explain foreign-app keychain prompts#1137
datlechin merged 7 commits into
mainfrom
fix/import-keychain-cancellation

Conversation

@datlechin

Copy link
Copy Markdown
Member

Fixes #1134

Problem

When importing connections from TablePlus / Sequel Ace with passwords:

  • macOS prompts for the user's login password once per keychain item because each item's ACL only grants access to its owning app, not TablePro. With ~3 items per TablePlus connection (db / ssh / key), N connections produced up to 3N prompts, which felt like a loop.
  • Pressing Esc on a prompt silently treated the read as "no value" and the loop kept going to the next item, prompting again. The loading screen had no Cancel button.
  • Esc also let the import "succeed" with no passwords, surprising the issue reporter.

This is by design at the OS level (per-item ACL is intentional to prevent silent cross-app credential siphoning), so the fix is at the UX layer: explain it, give the user a real Cancel, and treat the first denied prompt as "user wants to stop reading credentials".

Changes

  • ForeignKeychainReader.readPassword now returns KeychainReadResult { found / notFound / cancelled } instead of String?. Cancellation is no longer indistinguishable from "no value".
  • TablePlusImporter and SequelAceImporter carry an abortFlag through their credential reads. On the first .cancelled result, no further keychain reads happen for the remaining connections.
  • Both importers also call Task.checkCancellation() between connections so an in-app Cancel button propagates.
  • ForeignAppImportResult carries a new credentialsAborted: Bool flag (defaulted to false so DBeaver, which doesn't touch keychain, is unchanged).
  • ImportFromAppSheet shows a pre-import NSAlert explaining the per-item prompt behavior and how Always Allow works, only when Include passwords is on. The loading screen has a visible Cancel button that calls Task.cancel().
  • ImportFromAppPreviewStep shows an orange banner above the list when credentials were aborted, telling the user to enter remaining passwords manually after import.

Test plan

  • Quit TablePlus, install Sequel Ace + TablePlus with several connections. Open TablePro, File > Import from Other App, pick TablePlus with Include passwords ON. Confirm the explainer alert appears with a count.
  • Click Continue, then Esc the first macOS keychain prompt. Confirm no further prompts appear and the preview shows the orange "Some passwords were not read" banner.
  • Repeat with TablePlus, this time clicking Always Allow on each prompt. Confirm passwords land in the imported connections.
  • In the loading screen, click Cancel during a prompt sequence. Confirm the sheet dismisses and no half-imported state remains.
  • DBeaver import still works (no keychain involved, no banner, no explainer).
  • Source picker with Include passwords OFF skips both the explainer and the prompts entirely.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit 73868dc into main May 9, 2026
2 checks passed
@datlechin datlechin deleted the fix/import-keychain-cancellation branch May 9, 2026 14:22
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.

Import Connections Dialog has no way to cancel

1 participant