Bug 251463 - Error on piped ReadableStream leads to Unhandled Promise Rejection
Summary: Error on piped ReadableStream leads to Unhandled Promise Rejection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 16
Hardware: All All
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-31 15:22 PST by hazae41
Modified: 2023-03-27 00:25 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hazae41 2023-01-31 15:22:42 PST
Hey, the following code leads to an Unhandled Promise Rejection on some websites: 

```
new ReadableStream({ start: c => c.error("error") }).pipeTo(new WritableStream()).catch(() => {})
```

It also happens when calling controller.error after the pipe:

```
new ReadableStream({ start: c => window.c = c }).pipeTo(new WritableStream()).catch(() => {})

c.error("error")
```

Just run it in Safari console on latest macOS (Ventura 13.2) and latest iOS (16.0)

Websites where it happens:
- example.com
- bugs.webkit.org
- github.com
- facebook.com
- amazon.com
- blankwebsite.com

Websites where it doesn't happen:
- google.com
Comment 1 Radar WebKit Bug Importer 2023-02-07 15:23:16 PST
<rdar://problem/105149496>
Comment 2 youenn fablet 2023-03-23 08:15:47 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11864
Comment 3 EWS 2023-03-27 00:25:22 PDT
Committed 262137@main (3a75b5d2de94): <https://commits.webkit.org/262137@main>

Reviewed commits have been landed. Closing PR #11864 and removing active labels.