Skip to content

fix(runner): keep a mid-body network cut as a transport error in fetchDocsJson (DEV-3370) - #426

Merged
demtario merged 2 commits into
masterfrom
fix/docs-manifest-body-network-cut
Oct 12, 2026
Merged

demtario merged 2 commits into
masterfrom
fix/docs-manifest-body-network-cut

Conversation

@demtario

@demtario demtario commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Context

Sentry DEMOS-9C reported docs manifest for bucket "next" unparseable JSON (200 application/json) once. The event's cause chain is TypeError: Failed to fetch, not a SyntaxError: the headers arrived as JSON and the visitor's connection died mid-body, so res.json() rejected with the browser's transport error. fetchDocsJson relabelled every res.json() rejection as a bad artifact. The committed next manifest parses fine, so the deploy was not at fault. Now only a SyntaxError is 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

  • New example
  • Update to an existing example
  • README / documentation change
  • Demo runner (runner/) change
  • CI / tooling change

How was this verified?

Added a unit test in runner/pipeline/docs-catalog.test.mjs where res.json() rejects with TypeError: 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

  • New/renamed example: added to runner/config/frameworks.json (see CONTRIBUTING.md); otherwise it won't appear on demos.handsontable.com
  • New example: added a row to the tables in README.md
  • Ran pnpm build (and pnpm dev) in the affected example/server-example locally

No 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):

  1. DEV-3370 (Sentry DEMOS-9C)

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/json but the connection drops before the body finishes: fetchDocsJson now only wraps SyntaxError from res.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.

demtario and others added 2 commits October 12, 2026 09:12
…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>
@demtario demtario self-assigned this Oct 12, 2026
@demtario
demtario merged commit 1f59579 into master Oct 12, 2026
8 checks passed
@demtario
demtario deleted the fix/docs-manifest-body-network-cut branch October 12, 2026 08:18
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.

1 participant