mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
A Response body's stream gets a web ReadableStream view when a member the fetch stream lacks is read (for example `body.tee`). The view's source holds the stream, and the stream released the view only when that source was its last holder. While the transfer runs it holds the stream too, so a dropped body with a view kept a reference count of 2: the unobserved-response discard never ran, the paused socket was never resumed, and a compressed response dropped before HTTP EOF kept the process alive. The stream now releases the view when only the view's source and the live transfer hold it, and then takes the unobserved-response discard, as a body without a view does. The static-abandon-view fixture reads `body.tee` and `body.locked` of a 4 MiB incompressible gzip response from the new /gzip-incompressible route and drops it. It hung until the test's timeout before this change and now exits as Node does.