Skip to content

[$250] Fix doubled OpenApp on delegate (copilot) account switch #89265

@MelvinBot

Description

@MelvinBot

When a user switches into a copilot/delegate account via the account switcher, OpenApp fires twice — the first call resolves with skeletons visible, then a second OpenApp runs while skeletons are still visible, causing a noticeable double-loading experience on large accounts.

Two independent root causes:

  1. NetworkState reconfigure path: The CONNECT_AS_DELEGATE response updates SESSION.accountID. The SESSION subscriber in NetworkState.ts calls configureAndSubscribe() to rebuild the NetInfo subscription. Re-subscribing emits a synthetic null → true transition that the listener treats as a network recovery event → reconnect()openApp().

  2. DelegateAccessHandler recovery effect path: Onyx.clear(KEYS_TO_PRESERVE_DELEGATE_ACCESS) preserves HAS_LOADED_APP=true but not IS_LOADING_APP. After the clear, the state is briefly hasLoadedApp=true && isLoadingApp=undefined — exactly the trigger for the recovery effect, which fires its own openApp().

Related PR: #89254

Issue OwnerCurrent Issue Owner: @abzokhattab
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022049837260593240936
  • Upwork Job ID: 2049837260593240936
  • Last Price Increase: 2026-04-30

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsReviewingHas a PR in review

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions