Skip to content

fix(connections): report keychain failures as such, not as an unreachable SSH server - #934

Merged
NewtTheWolf merged 2 commits into
mainfrom
fix/932-keychain-error-label
Nov 10, 2026
Merged

NewtTheWolf merged 2 commits into
mainfrom
fix/932-keychain-error-label

Conversation

@debba

@debba debba commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Refs #932

Problem

Saving (or deleting) a connection writes the passwords to the OS keychain. When the keychain does not answer, for example a Secret Service provider that owns org.freedesktop.secrets but never replies, keyring returns:

Platform secure storage failure: DBus error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

The modal runs save errors through classifyConnectionError. That text matches the NETWORK rule ("timeout", "broken"), and with SSH enabled it is shown as SSH server unreachable, with the SSH tab flagged. The reporter's tunnel and database test both pass, so the message points them at the wrong thing.

The keychain code itself did not change between v0.26.0 and v0.27.0, so the underlying failure is environmental (the Secret Service on the reporter's machine is not responding). This PR fixes how we report it.

What changed

  • src/utils/connectionErrors.ts: new keychain category, matched before the SSH and network rules (secure storage, keychain, keyring, Secret Service, org.freedesktop.secrets). It also covers the snap hint and the "Failed to read the stored connection URI from the OS keychain" error.
  • New connectionErrors.keychain summary and recovery strings in all 11 locales. The recovery hint suggests checking that a Secret Service provider (GNOME Keyring, KWallet, KeePassXC) is running and unlocked, or turning off "Save passwords in Keychain" (each locale quotes its own label for that checkbox).
  • Since the kind does not start with ssh, the SSH tab is no longer marked as failing for these errors.

Verification

  • Reproduced the backend error with a fake Secret Service (Python/Gio) that takes org.freedesktop.secrets on an isolated dbus-run-session bus and swallows every call, plus a small crate using keyring 3.6.3 with the same features as Tabularis: set_password fails after about 2s with exactly the message from the issue.
  • New tests in tests/utils/connectionErrors.test.ts with the exact string from the issue (failed before the change, pass now).
  • pnpm vitest run tests/utils/connectionErrors.test.ts tests/components/modals/NewConnectionModal.test.tsx tests/i18n: all green.
  • tsc --noEmit and eslint clean.

…able SSH server

When the OS keychain does not answer (a Secret Service provider that owns
org.freedesktop.secrets but never replies), saving a connection fails with
"Platform secure storage failure: DBus error: Did not receive a reply ...
the reply timeout expired, or the network connection was broken". The
connection error classifier matched "timeout" and "broken" as a network
failure and, with SSH enabled, labelled it "SSH server unreachable", which
sent users to debug a tunnel that works.

Keychain errors now get their own "keychain" category, checked before the
SSH and network rules, with a recovery hint pointing at the Secret Service
provider and the "Save passwords in Keychain" option. The SSH tab is no
longer flagged for these errors.

Refs #932
@kilo-code-bot

kilo-code-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (13 files)
  • src/utils/connectionErrors.ts - Added "keychain" error kind with regex pattern and classification priority
  • tests/utils/connectionErrors.test.ts - Added comprehensive tests for keychain failure classification
  • src/i18n/locales/de.json - German translations for keychain error
  • src/i18n/locales/en.json - English translations for keychain error
  • src/i18n/locales/es.json - Spanish translations for keychain error
  • src/i18n/locales/fr.json - French translations for keychain error
  • src/i18n/locales/it.json - Italian translations for keychain error
  • src/i18n/locales/ja.json - Japanese translations for keychain error
  • src/i18n/locales/ko.json - Korean translations for keychain error
  • src/i18n/locales/pt-BR.json - Portuguese (Brazil) translations for keychain error
  • src/i18n/locales/ru.json - Russian translations for keychain error
  • src/i18n/locales/tl.json - Tagalog translations for keychain error
  • src/i18n/locales/zh.json - Chinese translations for keychain error

Reviewed by free · Input: 890.9K · Output: 4.9K · Cached: 1M

@NewtTheWolf NewtTheWolf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ported the keychain classification to the current web-ui paths, resolved the old-path conflicts and added the missing Vietnamese and Traditional Chinese message keys. Secure-storage failures are checked before SSH/network failures, so the DBus timeout from #932 receives the credential-store recovery message.

All 17 classifier tests and 8,791 frontend tests pass, with lint and typecheck green. Approved on c6a1736, subject to the current CI checks.

@NewtTheWolf
NewtTheWolf merged commit 7330c73 into main Nov 10, 2026
11 checks passed
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.

2 participants