I've been experiencing a bug where the web socket for the realtime API does not reconnect after my browser puts the page to sleep. Does anyone have any guidance regarding this?
I should add that I am using react JS and my realtime code is loaded in a useEffect.
I don't believe there is anything in the realtime client to combat this, but you could create an event listener for page visibility, when the page becomes visible again re-establish the realtime connection.
Thanks! Is it not bad practice to create a new realtime request when one already exists?
When the page goes to sleep the realtime connection is closed I believe, so you would need to re-establish it again.
Got it, thanks
I don't see that the connection status is exposed so I'm not really sure how you would check if there is an active connection or not before creating a new one /:
I'll try to just make a new one and see what happens. If it works, it works 🤷♂️
lmk how it goes
Re running the function does not seem to open a new websocket when one already is open. I have yet to test its sleep recovery
So far so good
Recommended threads
- Function deployment failed: Unable to re...
Hi Appwrite team, I have been experiencing persistent errors when i attempt to push my appwrite functions. The logs on the deployment detail page on the console...
- One to many 2 way, console UI not correc...
Hey, seems I'm facing the exactly same issue with this one: https://github.com/appwrite/appwrite/issues/6016 Since this Github issue stay open for so long, let ...
- Server Down
Appwrite services are down. When will they start working again?