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.

on_disconnect websocket handler is not called for all possible disconnects

See original GitHub issue

Currently on_disonnect callback is only called while handling GQL_CONNECTION_TERMINATE message, but the websocket can be disconnected in other places:

  • exception in handle_websocket_connection_init_message
  • on WebSocketDisconnect in websocket_server

Calling on_disconnect in those cases would be very useful to properly handle websocket related cleanups

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rafalpcommented, Apr 11, 2022

The change I’ve mentioned two comments above is now part of #834. It’ll be released with 0.15

1reaction
rafalpcommented, Apr 7, 2022

I’ll assign this to myself so I can give this another look after #834/#802 gets done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Websocket - How can I detect client disconnect
The WebSocketHandler afterConnectionClosed function is called after a websocket client disconnects. You simply need to override this in the manner that you ...
Read more >
WebSocket API: What does it mean that $disconnect is a best ...
What does it mean $disconnect is best-effort event? Does it mean $disconnect might not be triggered at all when the client is disconnected?...
Read more >
$connect and $disconnect routes - Amazon API Gateway
Client apps connect to your WebSocket API by sending a WebSocket upgrade request. If the request succeeds, the $connect route is executed while...
Read more >
NWConnection (web-socket) does not… - Apple Developer
NWConnection (web-socket) does not disconnect when server disconnects gracefully ... It is not possible to call SSL_write() after calling SSL_shutdown().
Read more >
WebSocket: close event - Web APIs - MDN Web Docs
This is specific to the particular server and sub-protocol. wasClean Read only. Returns a boolean value that Indicates whether or not the ...
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