WebSocket.close() should not wait for close
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | fixed |
People
(Reporter: canadahonk, Assigned: valentin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged], [wptsync upstream])
Attachments
(1 file, 1 obsolete file)
Looking at this WPT test: https://github.com/web-platform-tests/wpt/blob/master/websockets/interfaces/WebSocket/close/close-connecting.html
ws.close()
should not wait for the socket to close, rather just continue and report CLOSING
state. We (and Chromium) fail as close()
just immediately closes and runs the original onclose
handler as the new handler is defined after close()
is called. Safari passes.
Marking as unconfirmed as I'm not sure if this is intentional/expected/etc? If someone could confirm/correct that would be great.
Assignee | ||
Comment 1•2 years ago
|
||
https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.7
If The WebSocket Connection is Established prior to the point where
the endpoint is required to Fail the WebSocket Connection, the
endpoint SHOULD send a Close frame with an appropriate status code
(Section 7.4) before proceeding to Close the WebSocket Connection.
An endpoint MAY omit sending a Close frame if it believes the other
side is unlikely to be able to receive and process the Close frame,
due to the nature of the error that led the WebSocket connection to
fail in the first place. An endpoint MUST NOT continue to attempt to
process data (including a responding Close frame) from the remote
endpoint after being instructed to Fail the WebSocket Connection.
https://websockets.spec.whatwg.org/#dom-websocket-close
I think the test is right, as we're still handshaking at that time, but I might be wrong.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 2•1 year ago
|
||
ws.close()
should not wait for the socket to close,
rather just continue and report CLOSING
state.
WPT: https://wpt.fyi/results/websockets/interfaces/WebSocket/close/close-connecting.html%3Fdefault
Not sure if this is the correct approach,
it stops closing websockets from being kept alive.
Updated•1 year ago
|
Updated•11 months ago
|
Reporter | ||
Updated•11 months ago
|
Assignee | ||
Comment 3•11 months ago
|
||
For some reason the entire dir was disabled in bug 1273201.
Hopefully the frequent intermittents are gone now.
Updated•11 months ago
|
Assignee | ||
Comment 4•11 months ago
|
||
Comment 7•11 months ago
|
||
bugherder |
Description
•