cloudflare / cloudflare/workerd

🐛 Bug Report — `ReadableStream` don't propagate into `fetch` requests

Open
#5,114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

See for reproduction: https://github.com/cloudflare/workerd/pull/4543

Opening an issue mainly for visibility, since it's unclear if this was acknowledged as a bug.

**Note:** More details can be found on the reproduction than in this issue.

---

When a `ReadableStream` fails (or a converted `AsyncIterable`) any error on the source isn't observable on the `fetch` request and this doesn't propagate into a cancellation of `BodyStream` or the `fetch` request itself.

The error becomes unobservable and unhandled.

Workarounds here are problematic, because they require a conscious check of whether a `ReadableStream` enters any `fetch` request. This also makes this hard to verify. Any workaround with an `AbortController` doesn't guarantee that the error will propagate and an unhandled rejection will still occur.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.