Skip to content

fix: dismiss offline screen after connection recovery - #34508

Draft
abretonc7s wants to merge 3 commits into
test/android-recipe-validation-v3from
fix/offline-mode-auto-dismiss
Draft

fix: dismiss offline screen after connection recovery#34508
abretonc7s wants to merge 3 commits into
test/android-recipe-validation-v3from
fix/offline-mode-auto-dismiss

Conversation

@abretonc7s

Copy link
Copy Markdown
Contributor

Description

Automatically dismisses OfflineModeView when connectivity returns, but only when this hook previously presented that screen after the sustained-offline timeout.

Stacked on #34507 because it was reproduced during the Android lifecycle proof. The two-file fix is generic and can be retargeted/cherry-picked independently.

Why

The app correctly navigated to OfflineModeView after three seconds offline. On network restoration it tracked CONNECTION_RESTORED but never removed the screen, so the recovered Wallet Home and Perps order remained obscured until manual retry/navigation.

Test scenarios

Scenario: Recover after the offline screen was shown
  Given the app stayed offline long enough to show OfflineModeView
  When connectivity returns
  Then OfflineModeView is dismissed
  And the recovered underlying route is visible without manual retry

Scenario: Recover before the offline timeout
  Given connectivity returns before OfflineModeView is shown
  Then no navigation is dismissed

Validation

  • useConnectionHandler.test.ts: 7/7 pass.
  • Before recipe: android-offline-mode-auto-recovery-before-v1 failed the absent assertion; screenshot/video show the stale offline screen after network restoration.
  • After recipe: android-offline-mode-auto-recovery-after-v3 passed 9/9; screenshot/video show Wallet Home automatically restored.
  • Full network-recovery proof then passed 14/14 with the live ETH order visible and no manual retry.

Risk

The ref is set only after the hook's delayed navigation executes, so short outages and unrelated screens are never popped.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 78%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR modifies useConnectionHandler.tsx to add automatic dismissal of the OfflineModeView when connectivity is restored. Specifically:

  1. A new offlineModeShownRef ref tracks whether the offline modal was shown
  2. When connection is restored and the offline view was shown, navigation.goBack() is called to dismiss it
  3. The test file is updated to cover this new behavior

The hook is only imported by app/components/Nav/Main/index.js (the main navigation component). This is a UX improvement to offline mode handling — previously the offline view would persist even after connectivity was restored.

Risk assessment:

  • The change is contained to the connection handler utility
  • It only affects behavior when the device goes offline and then comes back online
  • The navigation.goBack() call could theoretically cause issues if the navigation stack is in an unexpected state when connectivity is restored
  • No core wallet flows (transactions, accounts, swaps) are directly affected

SmokeWalletPlatform is selected as it covers core wallet platform features and exercises the main navigation component where this hook is used. This provides a reasonable smoke test to verify the navigation behavior hasn't been broken. No other tags are needed as the change is isolated to connectivity/offline handling and doesn't touch transaction, account, swap, or other specialized flows.

Performance Test Selection:
The change adds a navigation.goBack() call when connectivity is restored after showing the offline view. This is a minor UX fix with no meaningful performance impact on app launch, login, asset loading, swaps, or any other measured performance scenario. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant