Replies: 1 comment 5 replies
-
hey there, this feels like an react-native/ios specific issue.
It doesn't? You can control the reconnection mechanisms with the various retry properties in the client options.
You can simply hook into the
Close code 1006 is a WebSocket spec close code which is used for abrupt and unhandled closures - it can mean many things.
Well if the socket connection does not exist in the first place, there is nothing to close/terminate. The terminate method is for stuck connections.
The client already does this. All active subscriptions will re-subscribe when the client reconnects automatically. Does this not happen? P.S. I've also noticed that you're not using the - retryWait: () => 2000,
+ retryWait: () => new Promise((resolve) => setTimeout(resolve, 2000)), |
Beta Was this translation helpful? Give feedback.
-
Hi, we are using graphql-ws in an app using react-native-webview. It actually work quite well untill we switch to another app or put the app in background mode.
Expected Behaviour
Actual Behaviour
All subscription stop working and could not work even when we tried to resubscibe.
We got this after reopen the app.
Further Information
client.terminate()
and it is not working because the socket connection is completely shutdown, not in pending state.close_code === 1006
then re-register all previous subscription like bellow but feel like it should be a cleaner, better and easier way to do this.I think we should have a method allow re-init all socket connection and subscriptions when needed. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions