Repository navigation
fix(cli): wait for postgrest after local db reset (CLI-3162) - #7716
Merged
7ttp merged 2 commits intoNov 19, 2026
Merged
Conversation
Contributor
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 9 commands. Binary size: 135.2 MB, down 4.0 KB from 135.3 MB. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
7ttp
deleted the
7ttp/cli-3162-local-db-reset-on-cli-320-can-exit-before
branch
November 19, 2026 15:50
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.
TL;DR
the first Data API request after a local
db resetnow sees the reset schema instead of a 503, a 400 or the old schemawhats broken?
db resetrecreates the database while PostgREST keeps running, so PostgREST drops its connection and reconnects after a short backoff, missing the schema reload that migrations sendreset never waited for it, so it could print
Finished supabase db reset.while PostgREST was still offline or serving the old schemanow fixed by:
restarting PostgREST once migrations and seeds are done so it loads the reset schema, reloading the API gateway to route to it, then waiting until PostgREST reports ready through the gateway
a failure in this step only prints a warning and the reset still succeeds. the
[experimental] stackpath is unchangedvisual rep
%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "mainBkg": "transparent", "primaryColor": "transparent", "secondaryColor": "transparent", "tertiaryColor": "transparent", "actorBkg": "transparent", "noteBkgColor": "transparent", "labelBoxBkgColor": "transparent", "activationBkgColor": "transparent", "primaryBorderColor": "#8b949e", "actorBorder": "#8b949e", "actorLineColor": "#8b949e", "noteBorderColor": "#8b949e", "labelBoxBorderColor": "#8b949e", "lineColor": "#8b949e", "signalColor": "#8b949e", "textColor": "#8b949e", "actorTextColor": "#8b949e", "signalTextColor": "#8b949e", "noteTextColor": "#8b949e", "labelTextColor": "#8b949e", "loopTextColor": "#8b949e"}, "sequence": {"mirrorActors": false}}}%% sequenceDiagram participant cli as CLI participant db as database participant rest as PostgREST participant gw as API gateway participant app as your app alt before Note right of cli: supabase db reset cli->>db: recreate db--xrest: connection dropped Note right of rest: reconnects in 1s, 2s, … cli->>db: migrations + seed db--xrest: reload notice missed while reconnecting Note right of cli: Finished supabase db reset. app->>gw: GET /rest/v1/ gw->>rest: forward rest-->>gw: 503, 400 or old schema gw-->>app: request fails else now Note right of cli: supabase db reset cli->>db: recreate, migrations + seed Note right of rest: restarted rest->>db: load reset schema cli->>gw: reload loop every 1s until ready cli->>gw: ready? gw-->>cli: 200 end Note right of cli: Finished supabase db reset. app->>gw: GET /rest/v1/ gw->>rest: forward rest-->>gw: 200, reset schema gw-->>app: new column is there endref: