Skip to content

fix: add signalingState guard in ICE restart handler (WT-986)#1002

Closed
SERDUN wants to merge 5 commits intodevelopfrom
fix/wt-986-ice-restart-signaling-state-guard
Closed

fix: add signalingState guard in ICE restart handler (WT-986)#1002
SERDUN wants to merge 5 commits intodevelopfrom
fix/wt-986-ice-restart-signaling-state-guard

Conversation

@SERDUN
Copy link
Member

@SERDUN SERDUN commented Mar 17, 2026

Summary

  • Wraps the ICE restart block with a double `signalingState` check to prevent a crash when a remote offer arrives mid-flight
  • Outer guard prevents starting a conflicting restart if the peer connection is not in stable state
  • Inner guard prevents calling `setLocalDescription` (and sending the `UpdateRequest`) if state changed during the async `restartIce()` + `createOffer()` gap
  • Adds warning logs when ICE restart is skipped due to non-stable signaling state
  • Includes `call_state_test.dart` — unit tests for `ActiveCall`, `CallState`, transfer state machine, audio device helpers, `CallServiceState`, and `JsepValue` SDP parsing (added as a separate concern to fix analyzer warnings that blocked the push)

Test plan

  • Verify ICE restart still works on a normal call reconnect
  • Verify no crash occurs when a remote offer arrives while ICE restart is in progress

@SERDUN SERDUN requested a review from Copilot March 17, 2026 09:31
@SERDUN SERDUN added draft Not ready but can be start to review labels Mar 17, 2026

This comment was marked as resolved.

@SERDUN
Copy link
Member Author

SERDUN commented Mar 17, 2026

Closing in favour of a consolidated PR that includes the ICE restart guard, renegotiation guard, and glare condition fix together.

@SERDUN SERDUN closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft Not ready but can be start to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants