Skip to content

Cancel discarded HTTP response bodies - #77

Merged
Jason-Doyle merged 3 commits into
mainfrom
experiment/discarded-response-bodies
Dec 5, 2026
Merged

Jason-Doyle merged 3 commits into
mainfrom
experiment/discarded-response-bodies

Conversation

@Jason-Doyle

@Jason-Doyle Jason-Doyle commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Change

Initiate best-effort cancellation when HTTP object and bundle readers discard
missing/error/fallback bodies. The production change is 12 added lines in one
module: four calls and one private helper.

Existing status policy, error type/status/key/message, successful consumption,
conditional reads, requests, ETags, byte accounting, public APIs and formats
are unchanged. Cancellation promises are not awaited; synchronous custom-hook
throws and rejected promises do not replace the status outcome.

Custom fetch implementations must treat their responses as reader-owned.
Discarded bodies can now become disturbed and invoke cancellation hooks.
Locked streams cannot be forcibly cancelled, and underlying cleanup may fail
or remain pending.

Evidence

Qualification report, exact tables, graphs and raw observations

  • Prospective protocol 295b76d preceded production edits. Source, fixtures,
    tests and verifier were frozen at 722dc35 before the sole scored comparison.
  • All 54 candidate ownership/status contracts pass versus 18/54 historically.
    All public outcomes are unchanged; all 18 complete controls match.
  • Independent verification rebuilds both complete API graphs and the fixture
    graph, checks 172 frozen inputs, replays all 108 rows and verifies every CSV
    cell, graph bar and original native attachment.
  • One zero-retry invocation passes 162 paired native tests, 324 observations
    and 54 controls across Chromium, Firefox and Windows WebKit.
  • All 1,025 related cases in 27 files, repository/Studio/Worker and fixture
    types, package/isolated-consumer checks and 54 complete built probes pass.
    Historical focused substitution passes 28 and fails the 43 targeted cases.

Merge-worthiness: 93/100. Every hard gate and required review remains mandatory,
including full normal CI and CodeQL on this exact publication head.

Limits

These are controlled native Response/ReadableStream interface observations,
not actual HTTP/TCP or provider measurements. Source execution initiates
cancellation rather than leaving it to the driver; total measured cancellation
calls are unchanged after driver cleanup. No connection-reuse, memory, CPU,
latency, throughput or production-incidence improvement is claimed.

No dependency, infrastructure, workflow, deployment, release or parked-series
change is included. Documentation, changelog and website discovery describe
the ownership change and its limits.

Publication-head checks

On c7373a7acaa2d27ec50112c8f5703b216e3aa0c7,
normal CI
passes all 23 steps on its first attempt with Node 22.23.5, including the
supported-Node site build, package/scaffold checks, both container runtimes
and Helm/kind/Kubernetes smoke. CI records 1,249 unit, 1,225 browser and 17 site
passes. Existing conditional skips remain unchanged at 3/2/1 respectively;
all 71 new unit cases and 162 new browser pairs run.

CodeQL
passes both jobs and all 20 steps on its first attempt. All four checks
succeed on the exact publication head. Human review and merge remain required.

@Jason-Doyle
Jason-Doyle merged commit 6915343 into main Dec 5, 2026
4 checks passed
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