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
- GB Hours IS NOT resetting
Hi, I was checking my usage and noticed that all of my usage quotas were reset on August 20, 2026, when my billing cycle renewed. Everything else appears to ha...
- Confused about Appwrite Pro pricing
Hi. I've been subscribed to the $25 Appwrite Pro plan, but I've been getting charged $40. I have two projects on my account. I was wondering where exactly the e...
- How can I disable client-side account re...
Hi everyone! I’m currently building a game backend using Appwrite, and I’d like to prevent users from creating new accounts directly through the client. My go...