fix: Test Connection on saved ds uses Keychain when password is blank#99
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
LoadConfigdeliberately 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 previoushandleTestsent that empty string toTestDatasource, 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'sidmatches a saved datasource and the password field is blank, route Test throughGoApp.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 existingTestDatasourcepath.handleTestnow passesbuildDs()so the stableidflows through to the outer handler.Test plan
npx vitest run— 425 frontend tests pass, including newConnectionManagertest covering the saved-ds-with-blank-password branchtsc --noEmitcleanwails dev, save a connection, restart, open the connection in edit mode, click Test Connection without typing the password → should succeedTestDatasource)TestDatasource