Repository navigation
fix(dashboard): show a proxy's 502/503 page as a temporary outage - #31882
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The fallback is decided in one place that both transports call, there is a screenshot of this revision, and nothing outside the patch compares a message against [DESIGN-REVIEWED] b5c853a Description read[DESCRIPTION-READ] e138bcd181d11b560d714dd3189b176da8c40f59d9acd0d7b09c06cce8cd3d75 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: this is a copy-only change, the screenshot shows the new sentence, and the blind reader read "temporarily" as "waiting and trying again would work", which is what the PR wants. Notes
[UX-REVIEWED] b5c853a Description read[DESCRIPTION-READ] d9cf305563727b3fc3f51390b5d948d1bb3506532cff718e8fcd0a2172e42d71 That sha256 names everything this verdict read: the PR description, plus the 4 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This is a small fix tied to issue #9582. Both shared transports now share one fallback, and nothing in the diff blocks it. What this change shipsInventory (5 items) — 5 justifiedIntent: when a gateway restarts behind a tunnel or proxy, users should see that the outage is temporary and that they can retry. FIX.
[FIRST-PRINCIPLES-REVIEWED] b5c853a Description read[DESCRIPTION-READ] 48565742a9f87a651706c4605a56cd890ffc567e3a931fa06bbff0bbab575576 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
9453bfa to
abbceba
Compare
|
Rebased: main moved in [operator: bolichen97] |
|
[operator: bolichen97] Backend Tests shard 2 (Linux and Windows), and the Coverage Gate behind them, are red on The Opus finding on the repeated "Try again in a moment." sentence is valid. It gets fixed in that same push. |
A tunnel or proxy answers with its own HTML page while the gateway restarts, and since #9484 that page reads as a bare "HTTP 502", which looks like a lasting failure. When such a page arrives with 502 or 503, the dashboard and app clients now say the server is temporarily unavailable, in every shipped language. Like the "HTTP 502" it replaces, the text names only the cause and has no end punctuation, so a message that wraps it keeps its own period and retry advice and says each once. A 504 keeps "HTTP 504", since the request may have run. A JSON or plain-text body keeps its own message, and a caller with a sentence of its own keeps it. Closes #9582
abbceba to
b5c853a
Compare
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved: PR Readiness passed on b5c853a, and all five review lanes (Opus 5.5, GPT 6.1, Design, UX, First Principles) report no blocking finding on this head. No conflict and no open change request.
…1882) A tunnel or proxy answers with its own HTML page while the gateway restarts, and since #9484 that page reads as a bare "HTTP 502", which looks like a lasting failure. When such a page arrives with 502 or 503, the dashboard and app clients now say the server is temporarily unavailable, in every shipped language. Like the "HTTP 502" it replaces, the text names only the cause and has no end punctuation, so a message that wraps it keeps its own period and retry advice and says each once. A 504 keeps "HTTP 504", since the request may have run. A JSON or plain-text body keeps its own message, and a caller with a sentence of its own keeps it. Closes #9582 (cherry picked from commit b3be506) Backport note: RestartButton.cov80.test.tsx keeps release's imports and window.confirm stub (main's confirmAction dialog helper and within import come from a later change not on release), so the new 502 case drops its confirmAction step.
Problem / Motivation
Goal: When a tunnel or proxy answers with its own error page while the gateway restarts, the dashboard says the server is temporarily unavailable and to try again, instead of a bare
HTTP 502.Since #9484, an edge or proxy HTML error page no longer leaks its markup into the error message. It falls through to
HTTP <status>instead, so a tunnel 502 during a gateway restart readsHTTP 502in the topbar and in error cards. That is accurate, but it gives no hint that the condition is temporary and worth retrying.Why it matters
Anyone reaching the dashboard through a tunnel or reverse proxy sees this every time the gateway restarts. A bare status code looks the same as a lasting failure, so the user has no reason to wait and retry rather than go looking for a fault.
Not a goal
toApiError.What changed (motivation → approach → change)
A proxy's own 502 or 503 page carries no human message, so both shared transports (
apiFailureinapi/client.tsandtoApiErrorinapi/apiError.ts) fell back toHTTP <status>. The 429 tunnel throttle already maps to a catalog sentence in the same module, so this follows that pattern.A new
statusErrTextinapi/apiError.tsis the fallback both transports now use: an HTML document body on 502 or 503 reads "The server is temporarily unavailable (HTTP 502)", and everything else still readsHTTP <status>. Like theHTTP 502it replaces, it names only the cause and has no end punctuation: a caller that wraps the message and adds its own period and next step (the Restart notice, the Duplicate alert) then ends the sentence once and gives the advice once, and a 502 after a POST is not told to repeat it.friendlyErrTextkeeps returning''for such a body, so callers that use it to ask "did the body carry a message?" keep their own sentence. The deploy page's pending-action card compares againststatusErrTextinstead of the literalHTTP <status>, so it still shows its own "Confirm failed (502)".The new key
api.client.server_temporarily_unavailable_http_statusis inen.manual.json, all eleven translated catalogs and the regenerateden-XApseudolocale, each in its style guide's register. Two comments that said the transport showsHTTP 502for such a page now say "status line".HTTP 502HTTP 504{"error": ...}or plain text, any statusHTTP <status>Backwards compatibility
Compatible: only the displayed message for an HTML 502/503 body changes. Status codes,
ApiError.body, retry policy and every caller's branching are unchanged.Removes nothing: the raw page stays on
ApiError.bodyand every other fallback message is the same.Tests
test/apiError.test.ts: an HTML 502 and 503 page give the new sentence throughtoApiErrorand keep the raw page onbody; an HTML 500 and 504 keepHTTP <status>.test/throttleRetry.test.ts: an HTML 502 through the dashboard'sjhelper (apiFailure) gives the new sentence.apps/dev-fleet/devFleetApi.test.tsandtest/PublishHub.proxyErrorPage.test.tsx: the app client and the publish banner, which used to pinHTTP 502, now pin the new sentence.HTTP ${r.status}, all five of those cases fail; the deploy-page and backfill-panel tests stay green either way.test/useSessionActions.test.tsx: a Duplicate refused by a proxy HTML 502 page alerts "Try again in a moment." once, with the reason built by the realstatusErrText.components/RestartButton.cov80.test.tsx: a restart refused the same way reads "Could not restart — The server is temporarily unavailable (HTTP 502). Wait a moment, …" with one period.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Built the SPA and served it with every
/apicall stubbed; the channel create answered with a proxy HTML 502 page. The dialog's error notice reads the new sentence (screenshot below). Catalog parity, style-guide,i18n:checkandi18n:rendergates pass.Screenshots / video
New Channel create answered by a proxy's HTML 502 page:
Before this change the same notice read
Failed to create channel HTTP 502.Related Issues
Closes #9582
Sibling sweep
Swept: git grep -n 'friendlyErrText|HTTP ${' -- website/src
Sibling: website/src/api/client.ts -- changed here
Sibling: website/src/api/apiError.ts -- changed here
Sibling: website/src/pages/ArtifactDeployPage.tsx -- changed here
Sibling: website/src/pages/settings/ChannelFolderBackfill.tsx -- not affected -- supplies its own sentence when the body has no message
Sibling: website/src/api/client/apps.ts -- not affected -- registry install stream throws its own text, outside the shared transports
Sibling: website/src/hooks/useSessionActions.ts -- not affected -- wraps the message and adds its own retry sentence, which the cause-only string leaves single
Sibling: website/src/components/RestartButton.tsx -- not affected -- its template adds the period after the reason, which the unpunctuated string leaves single
Pattern harvest
Not generalizable: a single fallback message for one class of proxy response, now decided in one function both transports call.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license (see CONTRIBUTING.md).