Skip to content

Fix P2P text chat timeout on WebRTC regions and delay voice renegotiation on disconnect#5706

Merged
Geenz merged 2 commits intorelease/2026.02from
roxie/webrtc-disconnect-fix
Apr 27, 2026
Merged

Fix P2P text chat timeout on WebRTC regions and delay voice renegotiation on disconnect#5706
Geenz merged 2 commits intorelease/2026.02from
roxie/webrtc-disconnect-fix

Conversation

@roxanneskelly
Copy link
Copy Markdown
Contributor

@roxanneskelly roxanneskelly commented Apr 24, 2026

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.

For WebRTC:

  • Do general smoke test.
  • Use clumsy with the following settings: "tcp or udp", lag 1000, drop 100%
  • set up a viewer on the machine with clumsy, and another viewer on a different machine.
  • Talk from the 'different machine' viewer so the other viewer can hear.
  • "Start" on clumsy
  • Validate that audio stops
  • Wait 10 seconds and validate that the talk button doesn't disable (it will after about 5 seconds on the release viewer)
  • "Stop" on clumsy
  • Expect audio almost immediately

…tion 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>
@github-actions github-actions Bot added the c/cpp label Apr 24, 2026
@roxanneskelly roxanneskelly requested a review from a team April 24, 2026 20:35
@roxanneskelly roxanneskelly marked this pull request as ready for review April 27, 2026 15:15
@Geenz Geenz merged commit 7719e6c into release/2026.02 Apr 27, 2026
13 checks passed
@Geenz Geenz deleted the roxie/webrtc-disconnect-fix branch April 27, 2026 21:38
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants