colyseus.js
colyseus.js copied to clipboard
WebSocket onError handler incorrectly accepts a CloseEvent
I found a log in our application from Colyseus.js:
Room, onError (undefined): undefined
That's coming from here: https://github.com/colyseus/colyseus.js/blob/2feff0ae5efa139e9fcf0af370852c418f7b2ce0/src/Room.ts#L76
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.