-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hooks not working after unmouting component #22
Comments
Hello @ejkkan Sorry I had not seen the issue, If my understanding is correct, it would be to be able to resume the websocket connection. This make sense, overall loss of connection of the websocket is not really supported by hasura-ws, on our production app we just reload show an error with a button to reload the whole app if connection is lost and login / logout will do a full reload too. Just curious, are you still using this library or did you move to a more popular lib like appolo or URQL ? Overall we had a bunch of issues with performances in hasura graphql subscriptions which was one of the main reasons we picked hasura in the first place, we are still using and supporting this client but I'm not sure I would use it for future products |
Hey @kigiri Interesting to hear! I'd be really interested to hear about your performance issues with hasura. I've yet to see them so any learnings would be greatly appreciated! |
Sure @ejkkan ! Here what happend to us: It was a bit of multiple issues that came together:
So, we had, complex queries, joining over multiple views getting spam every .5s by each of our active users, once we had about 300 active users our server was already starting to sweat. The way we solved it:
Is your implementation opensource ? |
Hey! First off, love the lib, really helped me out not having to write this client from scratch!
One usecase that is not working for me though.
I'm using "useSubscription" in a component on a route i only show for a logged in user.
If I log the user out, hence they leave the logged in route for a "login" route, and then go back to the logged in route again.
There scenarios takes place:
Part is because the hook needs the prepared query instantly at runtime, so you have to create the client outside the react function. So if you close it, it just never opens a new one.
My solution for now was just to skip the hook and use it like:
wsClient.subscribe(callback, query, {});
and overwrite my cached values instead
The text was updated successfully, but these errors were encountered: