Skip to content

fix(session): resolve stuck 'No internet' status after network restore#1095

Merged
SERDUN merged 2 commits into
developfrom
fix/stuck-no-internet-after-network-restore
Apr 10, 2026
Merged

fix(session): resolve stuck 'No internet' status after network restore#1095
SERDUN merged 2 commits into
developfrom
fix/stuck-no-internet-after-network-restore

Conversation

@SERDUN

@SERDUN SERDUN commented Apr 10, 2026

Copy link
Copy Markdown
Member

Problem

After turning internet off and back on, the app status gets stuck on "Connection error" or "Connection issue" even though a fresh reconnect attempt is already in progress.

Observed on: Samsung SM-M325FV, Android 13
Log: samsung-SM-M325FV-Android-13_2026-04-10_130044.logcat


Root Cause

__onSignalingClientEventConnecting in call_bloc.dart cleared only lastSignalingClientDisconnectError but left lastSignalingClientConnectError and lastSignalingDisconnectCode from the previous failed session:

// BEFORE — stale errors survive into the reconnect window
signalingClientStatus: SignalingClientStatus.connecting,
lastSignalingClientDisconnectError: null,
// lastSignalingClientConnectError ← NOT cleared
// lastSignalingDisconnectCode     ← NOT cleared

CallServiceState.get status evaluates these fields in priority order:

if (networkStatus == NetworkStatus.none)          → connectivityNone
else if (lastSignalingClientConnectError != null) → connectError   // ← stale error wins
else if (lastSignalingDisconnectCode != null)     → connectIssue   // ← stale code wins
...
else                                              → inProgress

So even when a fresh SignalingConnecting fires and the module is actively reconnecting, the UI shows "Connection error" or "Connection issue" until SignalingConnected clears them.


Fix

Clear all stale error fields in __onSignalingClientEventConnecting:

// AFTER
signalingClientStatus: SignalingClientStatus.connecting,
lastSignalingClientConnectError: null,    // ← added
lastSignalingClientDisconnectError: null,
lastSignalingDisconnectCode: null,        // ← added

As soon as a new connect attempt starts, the status correctly reflects inProgress ("Connection in progress") for the entire reconnect window.


Scope

  • One handler in call_bloc.dart
  • No model or API changes
  • SignalingConnected already clears these fields — this fix mirrors that behavior one step earlier (at Connecting)

SERDUN added 2 commits April 10, 2026 13:43
When SignalingConnecting fires after a failed connection attempt,
lastSignalingClientConnectError and lastSignalingDisconnectCode were
not cleared. This left the status stuck on connectError/connectIssue
('Connection error' / 'Connection issue') even though a fresh connect
attempt was already in progress.

After this fix, SignalingConnecting resets all stale error fields so
the status correctly shows inProgress ('Connection in progress') for
the duration of the reconnect.
@SERDUN SERDUN requested a review from Copilot April 10, 2026 10:57
@SERDUN SERDUN requested a review from digiboridev April 10, 2026 10:57
@SERDUN SERDUN marked this pull request as ready for review April 10, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an incorrect UI connection status that could remain stuck on “Connection error/issue” after network recovery by clearing stale signaling error fields as soon as a new reconnect attempt begins, aligning Connecting behavior with the existing Connected cleanup.

Changes:

  • Clear lastSignalingClientConnectError when a new SignalingClientStatus.connecting event is handled.
  • Clear lastSignalingDisconnectCode when a new SignalingClientStatus.connecting event is handled.

@SERDUN SERDUN merged commit 6cf1120 into develop Apr 10, 2026
5 checks passed
@SERDUN SERDUN deleted the fix/stuck-no-internet-after-network-restore branch May 22, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants