Async `onLeave` causes unhandled error when client disconnects
See original GitHub issueWhen the Client disconnected immediately, such as refreshing the page, and the Server has an async onLeave
, the following error is triggered:
WebSocket is not open: readyState 2 (CLOSING)
Presumably because Colyseus is trying to send the event stating that onLeave
has finished, but the client is already disconnected.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Async `onLeave` causes unhandled error when client ...
When the Client disconnected immediately, such as refreshing the page, and the Server has an async onLeave, the following error is ...
Read more >Using async/await in server causes client to disconnect - MSDN
Hi, In my application I needed a way to execute some code after a certain amount of time, and I used a solution...
Read more >flask-socketio Documentation
When a client disconnects it is removed from all the rooms it was in. The context-free socketio.send() and socketio.emit() functions also accept ...
Read more >c# - TcpClient disconnect during async read
1- If the client disconnected due to cable unplugged you will not know till the next read or write to the socket. also...
Read more >Handling unhandled promise rejections in async functions
unhandledRejection RequestError: HTTP request error. ... log.debug('client disconnected'); activeRequestHandler.abort(new Error('CLIENT_DISCONNECTED'));
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haven’t had the issue since, so I’ll close this. If it occurs again now that my projects are upgraded, I’ll re-open the issue. Thanks @endel!
I’m not sure this is the same problem as @seiyria reported here https://github.com/gamestdio/colyseus/pull/189#issuecomment-433772229, let me know if version
0.9.18
fixes this for you!