Repository navigation
panel: retry transient failures + maintenance overlay (survive roll cutovers) - #23
Merged
Merged
Conversation
…utovers) When the panel self-updates (Nomad canary roll), Traefik returns 502/503/504 for the cutover window and in-flight requests can fail at the network layer. The tRPC client had no retry config, so actions submitted then (e.g. Redeploy, a save) failed silently and a failed request read as a logout. - api.ts: isTransientError() + queryClientConfig retry — queries 5x, mutations 3x, ONLY on 5xx/network errors (never 4xx), exponential backoff capped at 5s. So an action during a cutover retries and succeeds once the panel is back. (In @trpc/next v11 queryClientConfig goes inside the config() return.) - maintenance-overlay.tsx + _app.tsx: a slim non-blocking 'Panel is updating — reconnecting…' banner that polls /api/health (15s healthy / 2s down) and auto-clears when the panel answers. Never traps the user. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Why
When the panel self-updates (a Nomad canary roll), Traefik returns 502/503/504 during the cutover (no healthy backend). The tRPC/React-Query client had no retry config, so any action submitted in that window (Redeploy, a var-file save) failed silently and a failed request read as a logout — the root cause behind "the panel loses my actions" / spurious logouts.
Sessions themselves are fine (DB-backed, stable
BETTER_AUTH_SECRET) — this is purely request resilience during the cutover.What
utils/api.ts):isTransientError()+queryClientConfigretry — queries 5×, mutations 3×, only on 5xx/network errors (never 4xx), exponential backoff capped at 5s. An action during a cutover now retries and succeeds once the panel is back, instead of being lost. (In@trpc/nextv11,queryClientConfigbelongs inside theconfig()return — verified type-correct there.)components/shared/maintenance-overlay.tsx, mounted in_app.tsx): a slim, non-blocking "Panel is updating — reconnecting…" banner that polls/api/health(15s healthy / 2s down) and auto-clears when the panel answers. Never a full-screen trap.Notes
This mitigates the user-facing impact of the panel-roll cutover (actions survive it) independently of solving the cutover 502s themselves (that remains a separate offline investigation).
Validation
scripts/check.shgreen (server build, 529 tests, app-tsc unchanged / 8 pre-existing). Biome clean.🤖 Generated with Claude Code