Closed Bug 1766716 Opened 2 years ago Closed 2 years ago

pipeTo with an aborted signal does not abort in a certain case

Categories

(Core :: DOM: Streams, defect, P3)

defect

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

Details

Attachments

(1 file)

let a = new AbortController()
a.abort()
let b = new File(['ó ¬—a'], 'a', {})
let c = new WritableStream()
await b.stream().tee()[0].pipeTo(c, { 'signal': a.signal })

This rejects right away on Chrome but never rejects on Gecko.

Component: XPCOM → DOM: Streams

The problem seems to be related to the promise returned from ReadableStreamCancel never resolving.

I think I've got it. For a tee'd stream to resolve both streams need to be canceled. https://streams.spec.whatwg.org/#abstract-opdef-readablestreamdefaulttee Step 14.3.3.

So this can be resolved as invalid?

Check the reference implementation behavior and file a spec bug if it also rejects right away as Chrome does?

Severity: -- → S3
Priority: -- → P3

The reference test has no File.stream 😬

I feel like it's the File method that is problematic here (either in Gecko or Blink), but I'm not anywhere yet to pinpoint.

Edit 1: Okay, comment #2 was right, canceling another branch does resolve it.

Edit 2: I successfully reproduced this with user-defined readable byte stream. The reference implementation shows the same behavior with Gecko, so this is Blink issue. I'll add a WPT test soon.

This passes on Gecko and the reference implementation but not on Chrome.

Pushed by krosylight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4aa40d4543da
Add a test for teed readable byte stream + pipeTo r=mgaudet
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34056 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: