fix(studio): invalidate pooler caches and clarify UI after db password reset#44216
Open
maharshi-coding wants to merge 1 commit intosupabase:masterfrom
Open
fix(studio): invalidate pooler caches and clarify UI after db password reset#44216maharshi-coding wants to merge 1 commit intosupabase:masterfrom
maharshi-coding wants to merge 1 commit intosupabase:masterfrom
Conversation
…d reset
After calling PATCH /platform/projects/{ref}/db-password, the mutation
only invalidated the project detail query. The Supavisor and PgBouncer
configuration queries (which include connection_string data) were never
refetched, leaving the Connect panel showing stale pooler state.
Additionally, the success toast and warning text gave no indication that
transaction pooler (port 6543) and session pooler (port 5432) connections
are affected by the reset and may take a moment to reflect the new
password, causing user confusion reported in supabase#44210.
Changes:
- useDatabasePasswordResetMutation now invalidates
databaseKeys.poolingConfiguration and databaseKeys.pgbouncerConfig
in parallel with the existing projectKeys.detail invalidation
- Success toast updated to mention pooler propagation
- Warning text updated to name affected ports (5432, 6543) and note
that poolers may take a short moment to reflect the new password
Fixes supabase#44210
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
Contributor
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
@maharshi-coding is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
Fixes #44210
After resetting the database password from Settings → Database → Reset database password, users reported that transaction pooler connections (port 6543) and session pooler connections (port 5432) continued to reject the new password, even though the Supabase SQL Editor worked fine.
Steps to reproduce:
pgin Node.js)password authentication failed for user 'postgres'Root cause
Two problems in the frontend:
1. Missing cache invalidation (data correctness)
useDatabasePasswordResetMutationonly invalidatedprojectKeys.detailon success. The two pooler configuration queries were never invalidated:databaseKeys.poolingConfiguration(ref)connection_stringdatabaseKeys.pgbouncerConfig(ref)After a password reset, the Connect panel's pooler connection strings could remain stale until the next page load.
2. No user guidance about pooler propagation
The success toast simply said
"Successfully updated database password"and the warning text said"Resetting it will break any existing connections"— neither mentioned:This left users confused when their pooler connections failed immediately after seeing a success message.
Changes
data/database/database-password-reset-mutation.tsdatabaseKeys.poolingConfiguration(ref)anddatabaseKeys.pgbouncerConfig(ref)in parallel with the existingprojectKeys.detailinvalidation so the UI fetches fresh pooler state immediately after resetcomponents/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsxTests
New file:
apps/studio/tests/features/database/DatabasePasswordReset.test.tsxpoolingConfigurationandpgbouncerConfigquery keysNotes
The underlying propagation delay on the backend (Supavisor/PgBouncer nodes picking up new credentials) is an infrastructure concern outside the scope of this repo. This PR ensures the frontend (a) keeps its own cache consistent immediately after reset, and (b) sets accurate user expectations via the UI.