Delivery & reliability
Reconnection
Reconnection creates a new live connection after the previous one closes or fails. A complete recovery flow also restores subscriptions and refreshes application state.
Also found under: Reconnect, Resubscribe
How it works
Networks change, devices sleep and servers restart. Treat disconnections as expected lifecycle events. A new connection may have a different identity and require fresh authorization. Restoring transport alone cannot tell you which application changes happened during the gap.
In a Pubb integration
Pubb's JavaScript client supports reconnecting and restoring its channels. Native WebSocket integrations must implement their own recovery. In either case, refresh durable state from your backend to account for missed events.
Connect a clientA practical example
After a phone switches networks, reconnect, authorize the current socket, restore its project subscription and request the latest project state from your API.