WebSocket can send and receive messages despite being closed #25536
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-io
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
If a WebSocket client's connection is closed by the server after its subscription has been canceled, it's still able to send messages. I haven't read the spec or examined the protocol-level interactions in detail, but this seems wrong.
What's more, Dart's WebSocket server will also receive this message—despite having called both
WebSocket.close()
andHttpServer.close()
. This is clearly wrong, since the documentation ofWebSocket.close()
says that it "closes the WebSocket connection".Here's a reproduction:
I reproduced this as of 77101d6.
I'd expect the socket to continue listening to the server behind-the-scenes even after the subscription is cancelled, so that it can determine when the connection is closed.
The text was updated successfully, but these errors were encountered: