Repository navigation
fix(runner): keep a mid-body network cut as a transport error in fetchDocsJson (DEV-3370) - #426
Merged
Merged
Conversation
…hDocsJson (DEV-3370) A docs manifest whose connection died after the JSON headers arrived made res.json() reject with the browser's TypeError: Failed to fetch, which was relabelled 'unparseable JSON'. Only a SyntaxError is a bad body now; anything else is rethrown untouched. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <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.
Context
Sentry DEMOS-9C reported
docs manifest for bucket "next" unparseable JSON (200 application/json)once. The event's cause chain isTypeError: Failed to fetch, not aSyntaxError: the headers arrived as JSON and the visitor's connection died mid-body, sores.json()rejected with the browser's transport error.fetchDocsJsonrelabelled everyres.json()rejection as a bad artifact. The committednextmanifest parses fine, so the deploy was not at fault. Now only aSyntaxErroris wrapped as unparseable JSON (a truncated artifact); anything else is rethrown untouched so it is classified as the transport failure it is.Types of changes
runner/) changeHow was this verified?
Added a unit test in
runner/pipeline/docs-catalog.test.mjswhereres.json()rejects withTypeError: Failed to fetch. It fails without the fix (the error was wrapped as unparseable JSON) and passes with it.node --experimental-strip-types --test pipeline/docs-catalog.test.mjs pipeline/fetch-diagnostics.test.mjs: 30 pass, 0 fail, including the existing truncated-JSON case.Checklist
runner/config/frameworks.json(see CONTRIBUTING.md); otherwise it won't appear on demos.handsontable.compnpm build(andpnpm dev) in the affected example/server-example locallyNo example added or renamed, so the first two items do not apply. The change is runner-only; no example build is affected.
Related issue(s):
Note
Low Risk
Narrow error-handling change in docs catalog loading with no security or data implications; improves Sentry grouping accuracy.
Overview
Fixes misclassification when a docs manifest fetch returns
200 application/jsonbut the connection drops before the body finishes:fetchDocsJsonnow only wrapsSyntaxErrorfromres.json()as an “unparseable JSON” artifact error. Any other rejection (e.g.TypeError: Failed to fetch) is rethrown unchanged so monitoring treats it as a transport failure, not a bad deploy artifact.A unit test asserts that a mid-body network cut surfaces the original transport error and is not tagged as missing docs resources.
Reviewed by Cursor Bugbot for commit 94af185. Bugbot is set up for automated code reviews on this repo. Configure here.