
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
- Better payment options for Indian users
Hii...Could you guys please add upi support for Indian users with payment in INR so that it becomes easier for us to pay automatically per month. Credit card is...
- Appwrite Integration
is it possible to Integrate Appwrite to my website . Like implemeting 'Connect Appwrite' ? Similar to what Supabase supports using OAuth2 that grant our applic...
- Nextjs Working with Node SDK and Web SDK
So I am using Nextjs v15 as a full stack and im not sure what the proper flow is I am trying to compare with supabase where i make a server client and a client...
