Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 54cffb8bc0c7ceaf24819e9a75806301f7baf2f3
https://github.com/WebKit/WebKit/commit/54cffb8bc0c7ceaf24819e9a75806301f7baf2f3
Author: Alex Christensen <[email protected]>
Date: 2026-07-28 (Tue, 28 Jul 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any.serviceworker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any.sharedworker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any.worker-expected.txt
M Source/WebCore/Modules/filesystem/FileSystemWritableFileStreamSink.cpp
M Source/WebCore/Modules/filesystem/FileSystemWritableFileStreamSink.h
M Source/WebCore/Modules/mediastream/VideoTrackGenerator.cpp
M Source/WebCore/Modules/mediastream/VideoTrackGenerator.h
M Source/WebCore/Modules/streams/StreamTransferUtilities.cpp
M Source/WebCore/Modules/streams/WritableStreamSink.cpp
M Source/WebCore/Modules/streams/WritableStreamSink.h
M Source/WebCore/Modules/streams/WritableStreamSink.idl
M Source/WebCore/Modules/webtransport/DatagramSink.cpp
M Source/WebCore/Modules/webtransport/DatagramSink.h
M Source/WebCore/Modules/webtransport/WebTransportSendStreamSink.cpp
M Source/WebCore/Modules/webtransport/WebTransportSendStreamSink.h
Log Message:
-----------
[WebTransport] WPT failure: Close and abort unidirectional stream
https://bugs.webkit.org/show_bug.cgi?id=320102
rdar://167645473
Reviewed by Youenn Fablet.
The WPT test streams-close.https.any "Close and abort unidirectional stream"
writes a chunk, calls writer.close() and then immediately writer.abort(e), and
expects close_promise, writer.closed, and abort_promise to all reject with e.
WebTransportSendStreamSink::close() was synchronous (the internal
WritableStreamSink.idl declared `undefined close()`), so the WritableStream
close algorithm resolved immediately and the subsequent abort() could not
preempt the in-flight close; close_promise resolved instead of rejecting.
Make the internal WritableStreamSink close() asynchronous (return
Promise<undefined>) and have WebTransportSendStreamSink observe the
WritableStreamDefaultController's abort signal, which fires synchronously during
writer.abort(). When an abort races an in-flight close(), the pending close is
rejected with the abort reason and the stream is reset (RESET_STREAM) rather
than sending FIN, matching the spec discussion at
whatwg/streams#1203.
The stream reset is delivered after the already-buffered chunk, so the server
may observe it later than the WPT test's fixed 10ms delay allows. Update the WPT
test to poll the server for the stream close info (query_stream_close_info)
instead of a single fixed delay; this test change is being upstreamed as
web-platform-tests/wpt#61525. Un-skip streams-close.https.any, which was
previously skipped for an internal streams-hang timeout.
Whether a synchronous abort() should take precedence over an in-flight close()
like this is still under discussion (whatwg/streams#1203);
the code carries a FIXME and https://bugs.webkit.org/show_bug.cgi?id=320232
tracks validating the approach.
Original PR by Basuke Suzuki. I just rebased it and undid the test changes.
*
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any.serviceworker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any.sharedworker-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/webtransport/streams-close.https.any.worker-expected.txt:
* Source/WebCore/Modules/filesystem/FileSystemWritableFileStreamSink.cpp:
(WebCore::FileSystemWritableFileStreamSink::close):
* Source/WebCore/Modules/filesystem/FileSystemWritableFileStreamSink.h:
* Source/WebCore/Modules/mediastream/VideoTrackGenerator.cpp:
(WebCore::VideoTrackGenerator::Sink::close):
(WebCore::VideoTrackGenerator::Sink::abort):
* Source/WebCore/Modules/mediastream/VideoTrackGenerator.h:
* Source/WebCore/Modules/streams/StreamTransferUtilities.cpp:
* Source/WebCore/Modules/streams/WritableStreamSink.cpp:
(WebCore::WritableStreamDefaultController::signal const):
(WebCore::WritableStreamSink::abortSignal const):
(WebCore::SimpleWritableStreamSink::close):
* Source/WebCore/Modules/streams/WritableStreamSink.h:
(): Deleted.
* Source/WebCore/Modules/streams/WritableStreamSink.idl:
* Source/WebCore/Modules/webtransport/DatagramSink.cpp:
(WebCore::DatagramSink::close):
* Source/WebCore/Modules/webtransport/DatagramSink.h:
* Source/WebCore/Modules/webtransport/WebTransportSendStreamSink.cpp:
(WebCore::WebTransportSendStreamSink::~WebTransportSendStreamSink):
(WebCore::WebTransportSendStreamSink::start):
(WebCore::WebTransportSendStreamSink::close):
(WebCore::WebTransportSendStreamSink::sendFin):
(WebCore::WebTransportSendStreamSink::abort):
(WebCore::WebTransportSendStreamSink::cancel):
* Source/WebCore/Modules/webtransport/WebTransportSendStreamSink.h:
Canonical link: https://commits.webkit.org/318102@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications