Skip to content

Reconnect the flipper right after the network returns or the tab wakes - #1567

Open
ekwav-agent wants to merge 3 commits into
Coflnet:mainfrom
ekwav-agent:ekwav-agent/task_l7737utyp7mce7oiq7mq
Open

ekwav-agent wants to merge 3 commits into
Coflnet:mainfrom
ekwav-agent:ekwav-agent/task_l7737utyp7mce7oiq7mq

Conversation

@ekwav-agent

Copy link
Copy Markdown
Contributor

Summary

Behaviour: Flipper resumes promptly after network return or wake-up, refreshes its countdown, and shows “Reconnecting…” while disconnected.

flowchart LR
    A[Online or visible again] --> B[Check socket health]
    B --> C[Reconnect stale socket]
    C --> D[Login and resubscribe]
    D --> E[Refresh countdown and status]
Loading
More detail

Change: Reuse existing recovery with immediate retries, preserving healthy and connecting sockets.

Test:

  • Online recovery: stalled socket remains on base; patch passes.
  • Visibility recovery: no replacement socket on base; patch passes.
  • Reconnecting indicator: absent on base; patch passes.
  • All 20 focused tests pass; desktop and mobile captures inspected and staged.

What is the worst that could happen?

Incorrect checks could trigger unnecessary shared-socket reconnects and delay consumers; reverting restores prior behaviour.

Test repair prerequisite

This change builds on the test repair in PR #1565 at commit 70047de244fdaa1000c8dd97da231c9fcc857ee2. Merge that PR first, then merge this one. This PR targets main in the upstream repository; GitHub does not use the prerequisite fork branch as its base.

Validation: 50/50 checks passed · reviewed in a separate claude session · dependencies unchanged.

Checks and provenance
  • node_26
  • npm_ci
  • production_build
  • test_server_ready
  • regression_base_fail_patch_pass
  • cypress_account-active-subscription_cy_ts
  • cypress_auction-start_cy_ts
  • cypress_auction_cy_ts
  • cypress_bazaar-plan_cy_ts
  • cypress_bazaar-snapshot-recovery_cy_ts
  • cypress_color-filter_cy_ts
  • cypress_copy-button_cy_ts
  • cypress_crafting-utils_cy_ts
  • cypress_crafts-multi-step_cy_ts
  • cypress_crafts_cy_ts
  • cypress_dom-translation_cy_ts
  • cypress_error-reporting_cy_ts
  • cypress_filter-result-id-utils_cy_ts
  • cypress_filter_cy_ts
  • cypress_flip-tracking-recovery_cy_ts
  • cypress_flipper-recovery_cy_ts
  • cypress_forge_cy_ts
  • cypress_generated-api-client_cy_ts
  • cypress_generated-api-response-utils_cy_ts
  • cypress_goal-utils_cy_ts
  • cypress_google-user-changed_cy_ts
  • cypress_hydration-safe-dates_cy_ts
  • cypress_in-game-command-utils_cy_ts
  • cypress_item-category-check_cy_ts
  • cypress_item-category-utils_cy_ts
  • cypress_item-filter-params-utils_cy_ts
  • cypress_item-redirect-utils_cy_ts
  • cypress_market-analysis_cy_ts
  • cypress_navigation-accessibility_cy_ts
  • cypress_node-toolchain_cy_ts
  • cypress_notification-targets_cy_ts
  • cypress_page-search-utils_cy_ts
  • cypress_player_cy_ts
  • cypress_rat-checker_cy_ts
  • cypress_recent-auctions-recovery_cy_ts
  • cypress_reduced-motion_cy_ts
  • cypress_rsc-cache-poisoning_cy_ts
  • cypress_search-rows-utils_cy_ts
  • cypress_search-shortcut_cy_ts
  • cypress_search_cy_ts
  • cypress_stale-chunk-recovery_cy_ts
  • cypress_startpage-favorites_cy_ts
  • cypress_terms-acceptance_cy_ts
  • cypress_year-view_cy_ts
  • authenticated_year_view_personas

Review notes:

  • Round 1: Flipper.tsx sets the indicator from !isSocketReady() when the page mounts, so "Reconnecting…" also shows briefly during the first connection on page load, not only after a drop.
  • Round 1: The 60 s "healthy" cutoff in WebsocketHelper listenForResume may sometimes reconnect a healthy socket when the tab becomes visible, if the server's nextUpdate/ping gap gets close to a minute; it never does this on every tab switch.
  • Round 1: The countdown re-request in Flipper.tsx fires after every reconnect, including ones started by the watchdog, which is slightly wider than the online/visibility case the task described but harmless.

Task: task_l7737utyp7mce7oiq7mq

Base: main at 70047de244fdaa1000c8dd97da231c9fcc857ee2

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.

2 participants