Repository navigation
fix(platform): stop reporting restart answers from the browser - #4033
Merged
Merged
Conversation
The browser reported every request that failed while the platform restarted as an error-level BackendApiError: the edge's UPSTREAM_UNAVAILABLE (502/503/ 504) while a deployment rolls, and the platform's 503 DATABASE_UNAVAILABLE while its database restarts. The backend itself treats both as operational events and reports neither, but each failed write or list read in each open tab opened a GlitchTip event of its own (tale/tale #109, #373, #371). prepareSentryEvent now drops a BackendApiError carrying one of these two codes at the statuses it comes with (isPlatformUnavailable). Every other 5xx still reports, including the backend's own 500 and a 502 the edge did not word, and either code at another status. The person still sees one toast for a failed write, with the draft kept, and the list's error state. The observability docs (EN/DE/FR), the manual error-code and automation registers, and a new PERF-B7 box say so.
#4031 adds PERF-B7 (a backend start during a database restart) to the same suite. Numbering this box PERF-B8 keeps the two IDs distinct whichever pull request lands first; the second to merge recounts the suite and readme totals.
…d-platform-restarts # Conflicts: # services/platform/tests/manual/readme.md
The new observability bullet used a plain space before its colon; the French pages use U+00A0 there (write-translations CONVENTIONS).
The UPSTREAM_UNAVAILABLE row claimed every write keeps its draft; the reproduction observed it for Create task (PERF-B8). Other surfaces keep their own draft rules.
Contributor
Author
|
Independent review (TALE-416): approved at
|
This was referenced Oct 1, 2026
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.
The browser no longer reports, as an error, a request that failed while the platform restarted. This covers the edge's
UPSTREAM_UNAVAILABLE(502, 503 or 504) during a deployment roll or restart, and the platform's503 DATABASE_UNAVAILABLEwhile its database restarts. The backend already treats both as operational events and reports neither. The browser opened one error-levelBackendApiErrorevent for every failed write and failed list read in every open tab: GlitchTip tale 109 and 373 (TALE-405, TALE-355), and 371 (TALE-353). Every other 5xx still reports.Closes #4032
What changed
app/lib/backend/platform-unavailable.ts(new):isPlatformUnavailable(error)is true only for aBackendApiErrorwhose code and status are one of these two answers:UPSTREAM_UNAVAILABLEat 502, 503 or 504, the edge's@machineDoorenvelope;DATABASE_UNAVAILABLEat 503, fromdatabaseUnavailableResponse.app/lib/sentry-normalize.ts:prepareSentryEvent, the app'sbeforeSend, drops such an event. It judgeshint.originalException, as the refusal rule does, never the event's text.platform-unavailable.test.tsreads the real app door's answer while its database restarts (the realappErrorHandleron a 57P01), and the edge's envelope as the Caddyfile writes it. It also checks what must stay false: the backend's text 500, a 502 with no code, a dependency's 503 (OBJECT_STORE_UNAVAILABLE), and either code at another status.sentry-normalize.test.tshas a new "an unavailable platform" block: drops at 502/503/504 and for the database, and keeps the 500, a codeless 502 and a text-only look-alike.DATABASE_UNAVAILABLEas its example. It now usesOBJECT_STORE_UNAVAILABLE, so it still proves what it was written for.observability-config.md(EN/DE/FR) lists the new exclusion; "Other server errors … are still reported".error-codes.mdrows for both codes say the browser sends nothing.automation.mdrow names the new spec.PERF-B8covers a write and a list while the app tier is away. The performance suite goes to 19 boxes and the readme total up by one (1063 after merging main atc278e4ec1).The person-facing behaviour is unchanged, and the reproduction below checks it. No edge, Ops or release change.
How I verified it
Real-browser reproduction. Inert and synthetic; nothing touched production.
docker-entrypoint.sh, on Caddy 2.11.4. Only file paths and compose names were rewritten to loopback.SENTRY_DSNpointing at a local sink.backend-api:3005closing its listener;pg_ctl -m fast;a703a95987975a138eBackendApiError: The platform is not answering right now — …BackendApiError: The platform’s database is not answering right now — …Request failed with status 500Negative control. With
main'ssentry-normalize.tsand the new tests, exactly the 4 new drop cases fail (UPSTREAM at 502/503/504, DATABASE at 503). All keep cases pass on both.Local gates, all run on this branch (none replayed from a cache):
vitest --project server app/lib backend/error-reporting.test.ts: 34 files, 352 tests pass.@tale/docsstructural suite: 37 files, 222 tests pass.oxlinton the changed files is clean. A planted floating promise was caught, so the type-aware path was live.tscon the changed files and their import closure: 0 errors.oxfmt,lint:manual,check-guide(performance suite),lint:links,lint:conflictsand opengrep (0 findings) are all clean.Not run locally: the whole-platform
tsc, the full unit/UI suites, knip andbackend:integration. They need more than this sandbox's 4 GiB, and CI runs them. No backend or database file changed.Coordination
backend/**file. TALE-353 and TALE-355 are the same browser events as TALE-405, and this change closes them too.UPSTREAM_UNAVAILABLE.PERF-B7to the same suite and bumps the same totals. That is why this box isPERF-B8. Whichever of the two lands second must mergemain, set the performance suite to 20 boxes and raise the readme total by one more.Left open
/eventsstream reopens, which backs off up to 60 s. That was 26–27 s after a 21 s outage here; Try again works at once. Not changed.