-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[$250] Fix doubled OpenApp on delegate (copilot) account switch #89265
Copy link
Copy link
Open
Labels
BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributorsReviewingHas a PR in reviewHas a PR in review
Metadata
Metadata
Assignees
Labels
BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributorsReviewingHas a PR in reviewHas a PR in review
Type
Fields
Give feedbackNo fields configured for issues without a type.
When a user switches into a copilot/delegate account via the account switcher,
OpenAppfires twice — the first call resolves with skeletons visible, then a secondOpenAppruns while skeletons are still visible, causing a noticeable double-loading experience on large accounts.Two independent root causes:
NetworkState reconfigure path: The
CONNECT_AS_DELEGATEresponse updatesSESSION.accountID. The SESSION subscriber inNetworkState.tscallsconfigureAndSubscribe()to rebuild the NetInfo subscription. Re-subscribing emits a syntheticnull → truetransition that the listener treats as a network recovery event →reconnect()→openApp().DelegateAccessHandler recovery effect path:
Onyx.clear(KEYS_TO_PRESERVE_DELEGATE_ACCESS)preservesHAS_LOADED_APP=truebut notIS_LOADING_APP. After the clear, the state is brieflyhasLoadedApp=true && isLoadingApp=undefined— exactly the trigger for the recovery effect, which fires its ownopenApp().Related PR: #89254
Issue Owner
Current Issue Owner: @abzokhattabUpwork Automation - Do Not Edit