-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(websocket): ignore resource close error #9755
fix(websocket): ignore resource close error #9755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to have a test. Will the WPT cover this?
Possibly - this is an internal Deno error we are exposing to the user though. No web API should ever through a |
This PR should probably be landed onto |
I'm going to pull the check into a helper function. Then yeah - let's cherry-pick it for 1.8.3 |
It is possible that the WebSocket is already closed when we try to close it with `WebSocket#close` or in the `error` or `close` events. Currently this leads to an uncatchable promise rejection. This changes this so that closing an already closed WebSocket is a noop.
211bb66
to
933e399
Compare
Making it a noop is a good idea, the websocket event gets called after |
It is possible that the WebSocket is already closed when we try to close it with `WebSocket#close` or in the `error` or `close` events. Currently this leads to an uncatchable promise rejection. This changes this so that closing an already closed WebSocket is a noop.
It is possible that the WebSocket is already closed when we try to
close it with
WebSocket#close
or in theerror
orclose
events.Currently this leads to an uncatchable promise rejection. This changes
this so that closing an already closed WebSocket is a noop.
Closes #9879
Closes #9958