rxdb icon indicating copy to clipboard operation
rxdb copied to clipboard

Websocket hangs after connection is closed by the server

Open brunovinicius opened this issue 4 months ago • 0 comments

GraphQL Websocket Plugin hangs and does not retry connection when server closes connection right after a successful 101 Upgrade. On my scenario this manifests itself as the client try to resume conection after refreshing auth token. WS connection is restablished way before the token is refreshed so it tries to connect using the old, expired token. After this, it gets stuck in this limbo as the server closes connection as soon as it validates the token.

Sequence of events looks similar to this:

=> GET wss://... <= 101 Switching Protocols => WS Message: connection_init (with the expired token) <= Server Closes connection

It seems like the client its not expecting this behavior and stays hanging in wait for the server to respond "connection_ack" which will never come. This scenario might arise due to a unfortunately timed network issue, but any directions on how my server could deal with this appropreately would be very much appreciated.

RxDB Version: 15.17

Thanks in advance and sorry for not providing a PR with a test case right away.

brunovinicius avatar Oct 18 '24 02:10 brunovinicius