You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fetch() resolves when its request body stream yields a non-byte chunk, cutting the body short #8078
If a JS-sourced ReadableStream used as a fetch() request body enqueues a chunk that is neither bytes nor a string (e.g. a number), the body pump fails, but fetch() still resolves. The request goes out with its body cut short, and the error only shows up as an uncaught exception from the pump's waitUntil task (and, for a pull source, in the source's cancel()).
Both implementations behave this way. Only the error text differs:
C++: TypeError: Draining read encountered a value that cannot be converted to bytes
TS (typescript_implemented_streams): TypeError: This ReadableStream did not return bytes.
The pump runs apart from the response (handleCancelablePump in http.c++), so its failure never reaches the fetch() promise.
We likely won't change the C++ side. We may revisit the TS-streams behavior, e.g. to surface the failure more usefully.
Activity