Implement transferable streams
Categories
(Core :: DOM: Streams, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: ricea, Assigned: saschanaz)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Steps to reproduce:
const rs = new ReadableStream();
window.postMessage(rs, '*', [rs]);
Actual results:
A "The object could not be cloned." DOMException is thrown because transferable streams are not implemented.
Expected results:
The window onmessage event should fire with the transferred stream as data, and the original stream should be locked.
See https://github.com/whatwg/streams/pull/1053 for the spec change and https://github.com/web-platform-tests/wpt/pull/24546 for the web platform tests.
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Mozilla needs to evaluate and declare an official position on this feature as a first step.
See: https://github.com/mozilla/standards-positions/issues/430
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Anne, per comment #1, do you think there's any blocker?
Updated•3 years ago
|
Comment 4•3 years ago
|
||
I think we should support this. I had missed the standards-positions issue. Replied there just now.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
Regarding [Transferable]
support, although it's not a blocker:
Assignee | ||
Comment 6•3 years ago
•
|
||
Let promise be ! ReadableStreamPipeTo(value, writable, false, false, false).
A reference for the future: https://searchfox.org/mozilla-central/rev/8e1eb5cbd89a2455c34032d921f8de28261d016b/dom/base/StructuredCloneHolder.cpp#1254
Assignee | ||
Comment 7•3 years ago
|
||
Assignee | ||
Comment 8•3 years ago
|
||
PackAndPostMessageHandlingError used in the transfer steps wants to clone DOMException.
Assignee | ||
Comment 9•3 years ago
•
|
||
transferable/window.html
fails with weird behavior. The last iframe test timeouts, but if I add breakpoints before two read()
calls in testTransferredReadableStream()
in resources/helpers.js
then it succeeds. I'm not sure why and how it matters here.
I believe the same issue affects several other tests too. AFAICT it only happens in cross-context situation 🤔
Edit: It was some event loop issue, still investigating...
Edit 2: It was not. It was a never-settled promise logic issue.
Updated•3 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 10•2 years ago
|
||
There is no guarantee for message events to always preceed delay(0)
.
Depends on D139525
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/180af79082fb Implement [Transferable] for ReadableStream r=smaug,sfink https://hg.mozilla.org/integration/autoland/rev/cc94267daae1 Fix tests using delay(0) r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34105 for changes under testing/web-platform/tests
Comment 13•2 years ago
|
||
Backed out for causing build bustages on Unified_cpp_netwerk_ipc0.obj
- Backout link
- Push with failures
- Failure Log
- Failure line: gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:659: Unified_cpp_netwerk_ipc0.obj] Error 1
Upstream PR was closed without merging
Comment 15•2 years ago
|
||
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a7f050ab968d Implement [Transferable] for ReadableStream r=smaug,sfink https://hg.mozilla.org/integration/autoland/rev/9442f1d617ea Fix tests using delay(0) r=smaug
Assignee | ||
Updated•2 years ago
|
Comment 16•2 years ago
•
|
||
Backed out for causing wpt failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/45cec5a178e5361a9b14cca089eef1be2730aafd
Link to failure log:
https://treeherder.mozilla.org/logviewer?job_id=378497677&repo=autoland&lineNumber=4020
https://treeherder.mozilla.org/logviewer?job_id=378499565&repo=autoland&lineNumber=4034
https://treeherder.mozilla.org/logviewer?job_id=378499530&repo=autoland&lineNumber=5865
Failure line:
TEST-UNEXPECTED-FAIL | /streams/transferable/transform-stream.html | piping through transferred transforms should work - assert_equals: transforms should have been applied expected "HELLO HELLO THERE THERE " but got "HELLO HELLO "
TEST-UNEXPECTED-FAIL | /streams/transferable/writable-stream.html | second write should wait for first underlying write to complete - promise_test: Unhandled rejection with value: object "TypeError: resolveWrite is not a function"
TEST-UNEXPECTED-FAIL | /streams/transferable/writable-stream.html | second write should wait for first underlying write to complete - assert_true: second write should have resolved expected true got false
Upstream PR was closed without merging
Updated•2 years ago
|
Assignee | ||
Comment 18•2 years ago
|
||
Depends on D144605
Comment 19•2 years ago
|
||
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6c2ff5402279 Implement [Transferable] for ReadableStream r=smaug,sfink https://hg.mozilla.org/integration/autoland/rev/848b3025ef7c Fix tests using delay(0) r=smaug https://hg.mozilla.org/integration/autoland/rev/454e9dcf4419 Add `dom.streams.transferable.enabled` r=smaug
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 20•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6c2ff5402279
https://hg.mozilla.org/mozilla-central/rev/848b3025ef7c
https://hg.mozilla.org/mozilla-central/rev/454e9dcf4419
Upstream PR merged by moz-wptsync-bot
Comment 22•2 years ago
|
||
FYI, docs work for this can be tracked in https://github.com/mdn/content/issues/16930#issuecomment-1145616374
The work was mostly just adding an entry to browser compatibility data for the three stream interfaces and an entry to the experimental features page.
Description
•