Parent resource issue: #266
Webview epic: #264
Host-message streaming: #329
Connected resources: #308
Proven gap
Current fetch(..., { signal }) races the native fetch promise and rejects the JavaScript caller when the signal aborts, but it does not cancel the underlying controlled Service Worker fetch. A worker whose respondWith() promise remains pending keeps one of the 32 active fetch slots until the independent 30-second waiter expires, and that timeout does not explicitly retire the worker-side request. Repeated aborts can therefore exhaust the controlled-fetch cap and retain worker promises, host-message stream writers, or response-body leases after the caller is gone.
Navigation and unregister retire some client state, but there is no per-request cancellation identity connecting the Window fetch task to the Service Worker fetch queue/promise.
Scope
- Give each abortable Window fetch a bounded native request identity and connect it to its controlled Service Worker request.
- Propagate
AbortSignal cancellation, native 30-second timeout, navigation, unregister, and shutdown to queued or dispatched worker fetches.
- Release the 32-fetch slot exactly once and reject/ignore every late response, host chunk, or settlement for a canceled request.
- Preserve browser
AbortError/custom abort reason behavior and removal of abort listeners after settlement.
- Keep parser/connected element loads, localResourceRoots admission, localhost mapping, CSS routing, and product-specific message channels outside this slice.
Acceptance
Proposed focused PR
One product-neutral controlled-fetch cancellation tranche from current main, limited to the native fetch/Service Worker state machine and a reduced WebPlatformSubset contract plus native lifecycle/performance gate.
Parent resource issue: #266
Webview epic: #264
Host-message streaming: #329
Connected resources: #308
Proven gap
Current
fetch(..., { signal })races the native fetch promise and rejects the JavaScript caller when the signal aborts, but it does not cancel the underlying controlled Service Worker fetch. A worker whoserespondWith()promise remains pending keeps one of the 32 active fetch slots until the independent 30-second waiter expires, and that timeout does not explicitly retire the worker-side request. Repeated aborts can therefore exhaust the controlled-fetch cap and retain worker promises, host-message stream writers, or response-body leases after the caller is gone.Navigation and unregister retire some client state, but there is no per-request cancellation identity connecting the Window fetch task to the Service Worker fetch queue/promise.
Scope
AbortSignalcancellation, native 30-second timeout, navigation, unregister, and shutdown to queued or dispatched worker fetches.AbortError/custom abort reason behavior and removal of abort listeners after settlement.Acceptance
respondWith()is pending, custom abort reasons, completion-vs-abort races, and late worker settlement.Proposed focused PR
One product-neutral controlled-fetch cancellation tranche from current main, limited to the native fetch/Service Worker state machine and a reduced WebPlatformSubset contract plus native lifecycle/performance gate.