question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Async `onLeave` causes unhandled error when client disconnects

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
oyedcommented, Nov 9, 2018

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!

0reactions
endelcommented, Oct 29, 2018

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found