Files
Roxanne SkellyandClaude Opus 4.6 4b7565370b Fix P2P text chat timeout on WebRTC regions and delay voice renegotiation on disconnect (#5706)
* Fix P2P text chat timeout on WebRTC regions and delay voice renegotiation on disconnect

Text chat: On WebRTC regions, getOutgoingCallInterface() returns nullptr,
causing mP2PAsAdhocCall to be true for all P2P sessions including text-only
IMs. This routed text chat through startP2PVoiceCoro which sent a "start p2p
voice" request and waited for a server reply that never came, resulting in a
30-second session initialization timeout. Fix by gating the p2p-as-adhoc
server init on mStartedAsIMCall so text-only sessions initialize immediately.

WebRTC: Split kFailed and kDisconnected handling in OnConnectionChange.
kFailed still renegotiates immediately. kDisconnected now waits 10 seconds
before renegotiating, giving the connection time to recover on its own. Uses
a sequence counter to ensure only the most recent disconnect transition can
trigger renegotiation, preventing stale delayed tasks from firing early
after disconnect/reconnect cycles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Revert im-change for not using the voice subsystem when doing a text-only IM

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-06 03:21:05 +10:00
..