Skip to content

Phone Island: WebRTC/Janus stability issues after network changes and standby #7785

@edospadoni

Description

@edospadoni

Description

Phone Island experiences several stability issues related to Janus/WebRTC connections after network changes, standby/lock screen return, and rapid WiFi toggling.


Issues

1. React Error #310 - App crash on quick WiFi toggle

Scenario: Rapidly disconnecting and reconnecting WiFi causes the application to crash with React error #310 (too many re-renders / infinite loop).

Cause: The socket ping check interval continues running during reconnection, and stale ping timeouts set the socket_down alert even after the socket has already reconnected, triggering repeated reload cycles.


2. Error 469 "Unexpected ANSWER" after network changes

Scenario: After network changes (WiFi switch, VPN toggle) or returning from system standby, incoming calls fail with Janus error 469.

Cause: The jsepGlobal (SDP offer) becomes stale after network changes. When the client tries to answer with an outdated offer, Janus rejects it.


3. Multiple Janus sessions being created

Scenario: After network disruption, multiple Janus sessions are created in rapid succession, causing resource leaks and unexpected behavior.

Cause: The destroy call was targeting the wrong reference (janus.current instead of the actual session instance), and there was no guard against concurrent initialization attempts.


4. Session destroyed but no new one created

Scenario: After certain network events, the Janus session is destroyed but a new one is never created, leaving the WebRTC in a broken state.

Cause: Session cleanup was performed before checking if initialization was already in progress, causing a race condition.


5. Infinite reload loop when network is down

Scenario: When the network goes completely offline, the app enters an infinite reload loop trying to reconnect.

Cause: The alert-based reload mechanism had no cooldown and no check for actual network availability.


6. Audio warm-up destroys active calls (NethLink)

Scenario: In NethLink, returning from lock screen with an active call causes the call to be terminated.

Cause: The phone-island-init-audio event triggers a test call for audio warm-up without checking if there's already an active call in progress.


Affected Components

  • phone-island - WebRTC.tsx, Socket.tsx, App.tsx
  • nethlink - PhoneIslandPage.tsx, ipcEvents.ts, main.ts (for NethLink-specific issues)

Metadata

Metadata

Labels

nethlinkThe issue is related to NethLink (NethVoice Desktop client)nethvoiceBug or features releted to the NethVoice projectnethvoice-ctiThe issue is related to NethLink (NethVoice Web client)testingPackages are available from testing repositories

Type

Projects

Status

Testing

Relationships

None yet

Development

No branches or pull requests

Issue actions