Skip to content

Retry sidebar bootstrap until a warming server answers - #2767

Open
Flame119052 wants to merge 1 commit into
get-bb:mainfrom
Flame119052:fix/sidebar-bootstrap-startup-retry
Open

Retry sidebar bootstrap until a warming server answers#2767
Flame119052 wants to merge 1 commit into
get-bb:mainfrom
Flame119052:fix/sidebar-bootstrap-startup-retry

Conversation

@Flame119052

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

Desktop cold start can open the window as soon as /health answers, while GET /api/v1/sidebar-bootstrap still 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, or AbortError.
  • 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_VERSION bump, 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

  • Added unit tests for retry classification, infinite retry vs the generic two-retry budget, and backoff.
  • Added hook tests: recover after six Failed to fetch failures; 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

AGENT GENERATED

Made with Cursor

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>
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.

Desktop cold start can leave the shell on a terminal "Failed to load projects." until an unrelated realtime event refetches

1 participant