fix(handoff): resolve database by connection host, not name alone#39
Merged
Conversation
resolve_existing_database_id matched a database registration by name and returned the first hit. When two registrations share a name (e.g. two `neondb`s pointing at different hosts), the SDK could bind verification to a registration whose stored connection points at a different physical database, so proofs were generated against the wrong rows. Pass the target connection host through from _onboard_database and prefer the registration whose stored `uri` matches it (confirmed via the database detail endpoint, since list payloads omit `uri`). Falls back to the previous first-match behavior when no host is supplied or none matches.
aural-psynapse
commented
Jun 11, 2026
aural-psynapse
commented
Jun 11, 2026
aural-psynapse
commented
Jun 11, 2026
aural-psynapse
commented
Jun 11, 2026
SimoneBottoni
approved these changes
Jun 12, 2026
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.
Two databases with the same name (e.g. two
neondbs on different hosts) makeresolve_existing_database_idpick the first one by name — which can be the wrong host, so we verify against the wrong database.Fix: also match on the connection host, not just the name.