Retry sidebar bootstrap until a warming server answers - #2767
Open
Flame119052 wants to merge 1 commit into
Open
Conversation
A cold-start race was leaving GET /sidebar-bootstrap terminal after two transport-only retries, so the shell stayed on Failed to load projects with no recovery path. 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.
Human comments
What was wrong
Desktop cold start can open the window as soon as
/healthanswers, whileGET /api/v1/sidebar-bootstrapstill fails. That query used the generic read retry (two attempts, 250ms, transport-only), so an HTTP 5xx from a warming server got zero retries. After the budget ran out the query was terminal (staleTime: Infinity, no focus/reconnect refetch while the socket is connected), and the compose error screen had no Retry. The shell stayed on "Failed to load projects." until an unrelated realtime invalidation. See #2533 and https://get-bb.github.io/reports/issues/2533.html.What changed
query-helpers.ts: sidebar-specific retry for transport failures plus 408/429/5xx, exponential backoff from 250ms capped at 4s, keep retrying while the error is retryable. Do not retry 401/403/404, parse errors, orAbortError.sidebar-navigation-query.ts: apply that policy on every observer of the sidebar bootstrap key so a later mount cannot overwrite it with the generic two-retry default.RootComposeView.tsx: add a Retry button on the "Failed to load projects." screen that refetches the bootstrap.No
HOST_DAEMON_PROTOCOL_VERSIONbump, no CLI/guide changes. Deviation from the issue's original six-retry sketch: retryable errors keep retrying at the 4s cap instead of stopping after ~12s, matching the expected "retries continue while the server is unreachable" behavior. The Retry button was listed as a follow-up in the issue and included here because the confirmed-repro report asked for it.How you verified
Failed to fetchfailures; retry a temporary 503; do not retry a 401.pnpm exec turbo run test --filter=@bb/app -- src/hooks/queries/query-helpers.test.ts src/hooks/queries/sidebar-navigation-query.test.tsx— 25 passed (red before the policy, green after).pnpm exec turbo run typecheck --filter=@bb/app— passed.Fixes #2533
Made with Cursor