Skip to content
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

WebSocket onError handler incorrectly accepts a CloseEvent #115

Open
ShukantPal opened this issue Mar 26, 2022 · 0 comments
Open

WebSocket onError handler incorrectly accepts a CloseEvent #115

ShukantPal opened this issue Mar 26, 2022 · 0 comments

Comments

@ShukantPal
Copy link

I found a log in our application from Colyseus.js:

Room, onError (undefined): undefined

That's coming from here:

console.warn(`Room, onError (${e.code}): ${e.reason}`);

The onerror event handler is incorrectly assuming that the WebSocket will pass a CloseEvent. A plain Event is passed instead. See the WebSocket API's error event has no specific type, while the WebSocket API's close event does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant