Skip to content

fix: Test Connection on saved ds uses Keychain when password is blank#99

Merged
nkcoder merged 1 commit into
mainfrom
fix/test-connection-uses-keychain
Jun 23, 2026
Merged

fix: Test Connection on saved ds uses Keychain when password is blank#99
nkcoder merged 1 commit into
mainfrom
fix/test-connection-uses-keychain

Conversation

@nkcoder

@nkcoder nkcoder commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

After restarting the app, clicking Test Connection on a saved datasource failed even though the password placeholder claimed it was stored in the macOS Keychain.

LoadConfig deliberately strips passwords from on-disk records, so the edit form opens with an empty password field and the placeholder "stored in macOS Keychain — type to change". The previous handleTest sent that empty string to TestDatasource, which then failed auth — making it look like the Keychain entry was lost. The actual Keychain entry was fine; the Connect path (PingDatasource) loads it correctly.

Fix

  • ConnectionManager.tsx: when the form's id matches a saved datasource and the password field is blank, route Test through GoApp.PingDatasource(id) (which reads the password from Keychain on the Go side). New connections, or any case where the user has typed a password, keep the existing TestDatasource path.
  • Inner form handleTest now passes buildDs() so the stable id flows through to the outer handler.

Test plan

  • npx vitest run — 425 frontend tests pass, including new ConnectionManager test covering the saved-ds-with-blank-password branch
  • tsc --noEmit clean
  • Manual: wails dev, save a connection, restart, open the connection in edit mode, click Test Connection without typing the password → should succeed
  • Manual: same flow, but type a different (wrong) password → should fail with auth error (verifies new password input still goes through TestDatasource)
  • Manual: brand-new connection form → Test Connection still works through TestDatasource

… blank

After restart, LoadConfig deliberately strips passwords from on-disk
records, so the edit form shows an empty password field with placeholder
"stored in macOS Keychain — type to change". Clicking Test Connection
in this state sent an empty password to TestDatasource and failed auth,
making it look like the Keychain entry was lost.

Route Test through PingDatasource (which loads the password from
Keychain on the Go side) when the form has a saved id and the password
field is blank. New password input or new connections keep the existing
TestDatasource path.
@nkcoder nkcoder closed this Jun 22, 2026
@nkcoder nkcoder reopened this Jun 22, 2026
@nkcoder nkcoder merged commit a4ca1de into main Jun 23, 2026
4 checks passed
@nkcoder nkcoder deleted the fix/test-connection-uses-keychain branch June 23, 2026 00:07
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