#Reconnecting websocket after inactivity
3 messages · Page 1 of 1 (latest)
Hi @coarse nebula. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources, I don't see specific information about exactly how long a period of inactivity will cause a Convex WebSocket to disconnect. The documentation indicates that Convex handles reconnection automatically, but doesn't specify the timeout period.
From the documentation, we know that:
If the internet connection drops, the client will handle reconnecting and re-establishing the Convex session automatically.
Convex React Documentation
Additionally, when using TanStack Query with Convex:
Subscriptions to Convex queries will remain active after the last component using
useQueryfor a given function unmounts forgcTimemilliseconds. This value is 5 minutes by default; if this results in unwanted function activity use a smaller value.
Convex with TanStack Query
However, this is about query subscriptions rather than the WebSocket connection itself.