apollographql / subscriptions-transport-ws

:arrows_clockwise: A WebSocket client + server for GraphQL subscriptions
https://www.npmjs.com/package/subscriptions-transport-ws
MIT License
1.52k stars 342 forks source link

Emit a Keep alive / Time out error #917

Closed RobinCPel closed 2 years ago

RobinCPel commented 2 years ago

Our team is currently using this library, and we would love it if we were able to log time-out issues. This PR makes it possible! ❤️

Note: When the WS connection times out, it has to be force closed when reconnect is not enabled, otherwise, checkConnectionIntervalId will keep on spewing out timed-out errors... forever. I don't know if this has any bad side effects? The tests still seem to pass just fine! ^^

TODO:

apollo-cla commented 2 years ago

@RobinCPel: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

RobinCPel commented 2 years ago

Nvm, we fixed it by implementing this library.

glasser commented 2 years ago

Good to hear. We are in the process of ensuring that everything in the Apollo platform supports the library you've found so that we can fully archive this project.