Repository navigation
Wait for the schema snapshot after refresh-schema - #1467
Merged
Merged
Conversation
refresh-schema returned as soon as a new snapshot was created, so a follow-up command that reads it could run before the snapshot was ready. Poll until schema_ready is true, and treat a snapshot that is still refreshing as action_required. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7a6c2a5. Configure here.
no-itsbackpack
approved these changes
Oct 10, 2026
A branch lookup that fails while waiting for the snapshot was reported as schema refreshing once the wait elapsed. Surface that error instead. Co-authored-by: Cursor <cursoragent@cursor.com>
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
pscale branch refresh-schemanow waits until the branch schema snapshot is ready (up to 2 minutes) before it reports success, so a follow-up command such asrouting-rules getsees the updated schema.schema refreshing; please try again in a few moments. In JSON mode that isaction_requiredwith codeschema_snapshot_not_readyand a retry hint.Test plan
go test ./internal/cmd/branch/ -run 'TestSnapshot_CreateCmd|TestRefreshSchema'go test ./internal/cmdutil/ -run TestGlobalJSONErrorSchemapscale branch refresh-schema <database> <branch>returns only afterschema_readyis truepscale branch routing-rules get <database> <branch>succeedsMade with Cursor