Skip to content

fix(handoff): resolve database by connection host, not name alone#39

Merged
SimoneBottoni merged 2 commits into
mainfrom
fix/resolve-database-by-host
Jun 12, 2026
Merged

fix(handoff): resolve database by connection host, not name alone#39
SimoneBottoni merged 2 commits into
mainfrom
fix/resolve-database-by-host

Conversation

@aural-psynapse

@aural-psynapse aural-psynapse commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Two databases with the same name (e.g. two neondbs on different hosts) make resolve_existing_database_id pick 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.

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.
Comment thread src/provably/handoff/_discovery.py Outdated
Comment thread src/provably/handoff/_discovery.py Outdated
Comment thread src/provably/handoff/_discovery.py
Comment thread src/provably/handoff/_bootstrap.py
@SimoneBottoni SimoneBottoni merged commit a3ba6f8 into main Jun 12, 2026
4 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