Closed Bug 1819782 Opened 1 year ago Closed 7 months ago

WebSocket.close() should not wait for close

Categories

(Core :: DOM: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
121 Branch
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.

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.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Status: UNCONFIRMED → NEW
Ever confirmed: true

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.

Assignee: nobody → oj
Status: NEW → ASSIGNED
Attachment #9354689 - Attachment is obsolete: true
Assignee: omedhurst → nobody
Status: ASSIGNED → NEW

For some reason the entire dir was disabled in bug 1273201.
Hopefully the frequent intermittents are gone now.

Assignee: nobody → moz.valentin
Status: NEW → ASSIGNED
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/25e8fec60e25
Fix websocket WPT and reenable websocket WPTs r=necko-reviewers,kershaw
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43206 for changes under testing/web-platform/tests
Whiteboard: [necko-triaged] → [necko-triaged], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: