-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing WebSockets from the server results in 'Close received after close' error #21642
Closing WebSockets from the server results in 'Close received after close' error #21642
Comments
can repro - note that this only happens on chromium, not firefox |
client workaround: ws.addEventListener('error', () => {
if (ws.readyState == ws.CLOSED) return onSuccess()
onError()
}) |
That workaround doesn't work for me, it still logs the message in the browser console |
still logs, but that's not important in my case, in my case i was showing an error screen and stopping the process as soon as an error event was fired. close received after close fires that error event, which made the process always fail |
I found only one Chromium bug that mentions the error message: https://crbug.com/40718979 The only thing I was able to find is that the following code is fired right after sending the close frame: Lines 752 to 755 in 942b2aa
But I don't know nearly enough about this and for all I know this might be intentional. |
I want to add that the |
Version: Deno 1.39.0
This is similar to #20948 except that in this case
WebSocket.close()
is called from Deno's end.While #20948 was fixed in #20518, this issue still seems to be reproducible.
This too seems to have regressed somewhere between 1.32.3 and 1.32.4.
To reproduce, run the following with
deno run --unstable -A foo.js
:Then visit http://localhost:8000/ and click the 'close' button.
The browser console logs:
The text was updated successfully, but these errors were encountered: