Engineering guides / Realtime communication and P2P engineering
By Arte Soft engineering · 24 October 2026
WebRTC reconnect and network handover: recover without duplicate sessions
Network recovery is a state-management problem as well as a connectivity problem. A call can regain a transport yet leave duplicated participants, stale audio or an interface that still says it is reconnecting.
Define the recovery policy first
Decide how long a session remains recoverable and what participants see while connectivity is uncertain. Separate a temporary media interruption from an explicit hang-up. If the application creates a replacement session, say how the old one is retired. Repeatedly calling “start” after every network notification can create overlapping connections and make the original problem much harder to diagnose.
Track session generations and ownership
Give each connection attempt an identity and ignore late messages from abandoned attempts. Signaling replies, candidate events and media callbacks can arrive after the interface has moved on. Ensure only the current generation can update visible state or schedule playback. The server should also understand which attempt belongs to the active call, especially when several devices are signed into the same user account.
Choose the appropriate repair mechanism
An ICE restart, renegotiation and a completely new session have different consequences. Use the mechanism supported by the transport and current state rather than treating every disconnect as the same failure. Preserve domain state such as participant identity and call permissions separately from transport objects. Recovery should not repeat an irreversible tool action or replay a previously delivered message merely because the connection was rebuilt.
Test actual handovers
A toggled airplane-mode test is useful but does not represent every transition. Try Wi-Fi loss while mobile data remains available, a return to Wi-Fi and a route change while speech is playing. Include both endpoints and a participant who stays connected throughout. Record whether audio resumes in both directions and whether the remaining participant receives an accurate status instead of a misleading permanent departure.
Make retries bounded and visible
Use backoff and a sensible stopping condition rather than reconnecting indefinitely in the background. Allow the user to cancel. When recovery fails, release microphone, camera and reserved server resources. If metering exists, define whether interrupted time is chargeable and how it is reconciled. A frozen call should not silently become an unlimited bill or leave a capture indicator active after the user has ended it.
Recovery acceptance sequence
- Begin a call, remove Wi-Fi while mobile data remains available and observe the state shown to both participants during the transition.
- Deliver a delayed message from the previous attempt and confirm that it cannot modify or terminate the recovered session.
- Cancel recovery, start a fresh call and inspect microphone, camera and billing state to ensure abandoned work has been released.
Demand a recovery regression script
The handover should include event timelines, tested transitions and known exceptions. GPT Realtime Assistant gives Arte Soft published realtime product context, while Wonek connectivity work is an R&D reference rather than an assurance about every carrier. A repair engagement should focus on reproducible state failures and verify the next clean session after each test. Reliable recovery includes what happens after giving up, not just the moment one interrupted call reconnects.
Relevant Arte Soft work
Wonek — communication engineering R&D, not a shipped or audited messaging product is our own product or engineering project. It provides context for the work we discuss here; it is not a claim of identical results for every client deployment.
Sources and further reading
Need help with Realtime recovery implementation?
Send the current app, system or brief, the behaviour you need and your constraints. We can agree a discovery, implementation or repair scope with concrete acceptance criteria.
Discuss this with Arte Soft