You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-11-09] [$175] Copilot-Not here page appears when copilot opens WS chat, switches account and goes to Inbox #102441
Version Number: 9.4.94-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#102124 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: MacBook Air 26.6.2 Chrome, iPhone 15 iOS 26.6.1 App Component: Left Hand Navigation (LHN)
Action Performed:
As User A, add User B as a copilot
As User A, create a workspace
As User B, switch to User A's account in Account tab
Go to Inbox, open workspace chat
Go to Account tab and switch back to the own account
Open Inbox
Expected Result:
Not here page is not shown
Actual Result:
"Not here" page appears when copilot opens WS chat, switches account back to their own account and goes to Inbox
Please re-state the problem that we are trying to solve in this issue.
A copilot opens a workspace chat while acting as another account. After they switch back to their own account and tap Inbox, they see "Hmm... it's not here."
What is the root cause of that problem?
Switching accounts clears Onyx, but it does not reset navigation.
connect() and disconnect() in Delegate.ts call only clearPreservedSearchNavigatorStates(). That function drops only the Search tab's saved state. The Inbox (Reports) split navigator keeps the other account's REPORT route.
When the user taps Inbox, InboxTabButton finds that the saved report no longer exists in Onyx. It falls back to Navigation.navigate(ROUTES.INBOX).
On wide layout, SplitRouter ignores a "push sidebar" action and keeps the current central screen. The stale report stays open.
The user has no access to that report, so ReportNotFoundGuard shows the not-found page.
What changes do you think we should make in order to solve the problem?
Handle a delegate switch like a session change for navigation. Do this in one shared place, for example next to clearOnyxForDelegateTransition(), so it covers connect, disconnect, and the session-restore paths.
Call clearPreservedNavigatorStates() instead of clearPreservedSearchNavigatorStates().
On web, clear the LAST_VISITED_PATH sessionStorage keys used to restore the Workspaces tab.
Reset the root navigator to a fresh tab navigator with new route keys. You can land on the Settings root or use Navigation.resetToAppRoot(). New keys remount ReportsSplitNavigator, so it drops the stale initial reportID too.
What alternative solutions did you explore? (Optional)
Fix the missing-report fallback in WideInboxTabButton so it replaces the central REPORT screen instead of calling Navigation.navigate(ROUTES.INBOX), which does nothing on wide layout. This fallback bug affects any deleted or missing report, not only copilot switches. It is worth fixing as a second layer, but it would not fix the Workspaces tab.
Confidence and open questions
Web (wide layout): high confidence. I traced every step in code but did not reproduce it live, because the repro needs two linked copilot accounts.
iOS (narrow layout): not confirmed. On narrow layout, the Inbox fallback pops the stack to the top, so this exact path does not explain the iOS report. The full navigation reset above should still cover it, because it removes all stale tab state.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/102441) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Copilot-Not here page appears when copilot opens WS chat, switches account and goes to Inbox[/-][+][$175] Copilot-Not here page appears when copilot opens WS chat, switches account and goes to Inbox[/+]on Sep 28, 2026
Please re-state the problem that we are trying to solve in this issue.
When a copilot (User B) acts as another account (User A), opens a workspace chat, switches back to their own account, and navigates to the Inbox tab, a "Hmm... it's not here" (Not Here) page appears instead of the user's Inbox chat list.
What is the root cause of that problem?
When switching delegate accounts (connect() or disconnect() in src/libs/actions/Delegate.ts), Onyx data for the previous account is cleared via clearOnyxForDelegateTransition(). However, the navigation state is not properly reset:
Delegate.ts only invokes Navigation.clearPreservedSearchNavigatorStates() rather than clearing all preserved navigator states:
clearPreservedSearchNavigatorStates() only purges preserved route state for the Search tab navigator.
The ReportsSplitNavigator retains the previous account's active REPORT route (User A's workspace chat reportID) in its preserved state.
When the user taps the Inbox tab after switching back to their account:
InboxTabButton detects that the saved reportID no longer exists in Onyx for User B and falls back to Navigation.navigate(ROUTES.INBOX).
On wide layouts, SplitRouter does not dismiss or reset the central screen when navigating to the sidebar root (ROUTES.INBOX), keeping the stale REPORT route active.
Because the report belongs to User A and no longer exists in User B's Onyx store, ReportNotFoundGuard triggers and displays the "Hmm... it's not here" screen.
What changes do you think we should make in order to solve the problem?
Clear All Preserved Navigator States on Delegate Switch:
In src/libs/actions/Delegate.ts:
Replace calls to clearPreservedSearchNavigatorStates() with clearPreservedNavigatorStates() in both connect() and disconnect() so that cached split-navigator states (including ReportsSplitNavigator) are cleared across delegate boundaries:
// In Delegate.ts (connect & disconnect)Navigation.clearPreservedNavigatorStates();
Reset Navigation to App Root on Delegate Transition:
Similar to the sign-out/session transition in NavigationRoot.tsx, reset navigation state upon completing connect() and disconnect():
Navigation.resetToAppRoot();
This ensures that the tab bar and split navigators remount with fresh route keys and without stale lastAccessedReportID references from the previous session.
Fallback in SplitRouter / InboxTabButton:
In src/components/Navigation/NavigationTabBar/InboxTabButton.tsx, when the target report is not found in Onyx on wide layout, ensure the central screen is cleared or reset to ROUTES.HOME / first available report rather than leaving the inaccessible report mounted.
What alternative solutions did you explore? (Optional)
Relying solely on ReportNavigateAwayHandler: ReportNavigateAwayHandler checks if the report is missing, but when unfocused or transitioning during account reload, it can fail to redirect before the ReportNotFoundGuard mounts. A full navigation reset alongside clearPreservedNavigatorStates() addresses the root cause deterministically.
Please re-state the problem that we are trying to solve in this issue.
When a Copilot (User B) acts as another account (User A), opens a workspace chat, switches back to their own account, and navigates to the Inbox tab, a "Hmm... it's not here" (Not Here / 404) page appears instead of the user's normal Inbox chat list.
What is the root cause of that problem?
In src/libs/actions/Delegate.ts:
When switching between delegate and primary accounts (connect() and disconnect() / restoreDelegateSession()):
Incomplete navigator state cleanup:
Lines 12, 137, and 201 call clearPreservedSearchNavigatorStates():
clearPreservedSearchNavigatorStates();
clearPreservedSearchNavigatorStates() was introduced in PR Submit query lingers on other member when switching accounts via copilot #73511 as a narrow fix for the Search tab. It purges keys starting with NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR.
However, it completely ignores all other split navigators, most notably ReportsSplitNavigator (NAVIGATORS.REPORTS_SPLIT_NAVIGATOR).
As a result, preservedNavigatorStates in usePreserveNavigatorState.ts retains the entire route state of ReportsSplitNavigator, including User A's active workspace chat reportID.
Re-attachment of inaccessible report state upon switching back:
When User B switches back to their own account, clearOnyxForDelegateTransition() correctly wipes User A's Onyx report data.
When User B navigates to the Inbox tab, restoreTabNavigatorRoutes reattaches the cached ReportsSplitNavigator state from preservedNavigatorStates.
On wide layouts, the split navigator attempts to mount the central REPORT screen with User A's workspace chat reportID.
Because that workspace chat belonged to User A and does not exist in User B's Onyx store, ReportNotFoundGuard (or ReportScreen) triggers and renders the "Hmm... it's not here" error page.
In contrast, full logout in src/libs/Navigation/NavigationRoot.tsx (lines 140–145) explicitly calls clearPreservedNavigatorStates():
// Drop the previous session's preserved navigator states. Otherwise restoreTabNavigatorRoutes// reattaches the prior TAB_NAVIGATOR subtree to the public sign-in route (which shares that name).clearPreservedNavigatorStates();
Because a delegate account transition switches the authenticated account context just like a session change, failing to clear all preserved navigator states leaves stale route subtrees attached to the new session.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/Delegate.ts:
Replace clearPreservedSearchNavigatorStates() with clearPreservedNavigatorStates() in both connect() and disconnect() / restoreDelegateSession():
diff --git a/src/libs/actions/Delegate.ts b/src/libs/actions/Delegate.ts--- a/src/libs/actions/Delegate.ts+++ b/src/libs/actions/Delegate.ts@@ -12,7 +12,7 @@ import type {OnyxCollection, OnyxUpdate} from 'react-native-onyx';
import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
import * as ErrorUtils from '@libs/ErrorUtils';
import Log from '@libs/Log';
-import {clearPreservedSearchNavigatorStates} from '@libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState';+import {clearPreservedNavigatorStates} from '@libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState';
import * as NetworkStore from '@libs/Network/NetworkStore';
import * as SequentialQueue from '@libs/Network/SequentialQueue';
import Pusher from '@libs/Pusher';
@@ -137,7 +137,7 @@ function connect(
Onyx.update(failureData);
return;
}
- clearPreservedSearchNavigatorStates();+ clearPreservedNavigatorStates();
const restrictedToken = response.restrictedToken;
const policyID = activePolicyID;
@@ -201,7 +201,7 @@ function disconnect() {
return restoreToStashed().then(() => false);
}
- clearPreservedSearchNavigatorStates();+ clearPreservedNavigatorStates();
const requesterEmail = response.requesterEmail;
const authToken = response.authToken;
Reset Navigation root state on delegate transition:
In src/libs/actions/Delegate.ts, call Navigation.resetToAppRoot() (or Navigation.reset(getStateToResetAfterLogout(navigationRef.getRootState()))) after clearOnyxForDelegateTransition(). This forces all tab split navigators to remount with clean initial routes, dropping stale lastAccessedReportID references from the previous user.
In src/libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState.ts:
Deprecate/remove the now redundant clearPreservedSearchNavigatorStates export in favor of canonical clearPreservedNavigatorStates.
Automated Unit Tests:
In tests/unit/actions/DelegateTest.ts:
Mock usePreserveNavigatorState's preservedNavigatorStates with mock states for REPORTS_SPLIT_NAVIGATOR and SEARCH_FULLSCREEN_NAVIGATOR.
Call connect() / disconnect() and verify clearPreservedNavigatorStates() is called, asserting preservedNavigatorStates is completely cleared across all navigator keys.
Verify that switching back to the primary account does not attempt to restore the copilot's private workspace chat route.
What alternative solutions did you explore? (Optional)
Selectively clearing only REPORTS_SPLIT_NAVIGATOR and SEARCH_FULLSCREEN_NAVIGATOR:
Rejected because workspaces, settings, and other split navigators can also contain private policy or account routes accessible only to Account A (e.g. Issue [Exploratory] Copilot - Not Here page appears after switching user back and navigating to workspaces #98721Copilot - Not Here page appears after switching user back and navigating to workspaces). Dropping all preserved states on delegate account switch guarantees security and UI consistency across all tabs.
Activity
applause-bot commentedon Sep 28, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/ef8f4f96530d5f11206537315f468abb8b5935372ef1953863daddcca27b7f3b
MelvinBot commentedon Sep 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A copilot opens a workspace chat while acting as another account. After they switch back to their own account and tap Inbox, they see "Hmm... it's not here."
What is the root cause of that problem?
Switching accounts clears Onyx, but it does not reset navigation.
connect()anddisconnect()inDelegate.tscall onlyclearPreservedSearchNavigatorStates(). That function drops only the Search tab's saved state. The Inbox (Reports) split navigator keeps the other account'sREPORTroute.InboxTabButtonfinds that the saved report no longer exists in Onyx. It falls back toNavigation.navigate(ROUTES.INBOX).SplitRouterignores a "push sidebar" action and keeps the current central screen. The stale report stays open.ReportNotFoundGuardshows the not-found page.Code references
REPORTkeeps an initialreportIDtaken fromlastAccessedReportIDat mount: ReportsSplitNavigator.tsx:41-65What changes do you think we should make in order to solve the problem?
Handle a delegate switch like a session change for navigation. Do this in one shared place, for example next to
clearOnyxForDelegateTransition(), so it covers connect, disconnect, and the session-restore paths.clearPreservedNavigatorStates()instead ofclearPreservedSearchNavigatorStates().LAST_VISITED_PATHsessionStorage keys used to restore the Workspaces tab.Navigation.resetToAppRoot(). New keys remountReportsSplitNavigator, so it drops the stale initialreportIDtoo.The same fix should also resolve [Exploratory] Copilot - Not Here page appears after switching user back and navigating to workspaces.
What alternative solutions did you explore? (Optional)
Fix the missing-report fallback in
WideInboxTabButtonso it replaces the centralREPORTscreen instead of callingNavigation.navigate(ROUTES.INBOX), which does nothing on wide layout. This fallback bug affects any deleted or missing report, not only copilot switches. It is worth fixing as a second layer, but it would not fix the Workspaces tab.Confidence and open questions
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/102441)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 28, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (
External)[-]Copilot-Not here page appears when copilot opens WS chat, switches account and goes to Inbox[/-][+][$175] Copilot-Not here page appears when copilot opens WS chat, switches account and goes to Inbox[/+]melvin-bot commentedon Sep 28, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022104643858077127375
ashusatyarthi-wq commentedon Sep 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a copilot (User B) acts as another account (User A), opens a workspace chat, switches back to their own account, and navigates to the Inbox tab, a "Hmm... it's not here" (Not Here) page appears instead of the user's Inbox chat list.
What is the root cause of that problem?
When switching delegate accounts (
connect()ordisconnect()insrc/libs/actions/Delegate.ts), Onyx data for the previous account is cleared viaclearOnyxForDelegateTransition(). However, the navigation state is not properly reset:Delegate.tsonly invokesNavigation.clearPreservedSearchNavigatorStates()rather than clearing all preserved navigator states:clearPreservedSearchNavigatorStates()only purges preserved route state for the Search tab navigator.ReportsSplitNavigatorretains the previous account's activeREPORTroute (User A's workspace chatreportID) in its preserved state.When the user taps the Inbox tab after switching back to their account:
InboxTabButtondetects that the savedreportIDno longer exists in Onyx for User B and falls back toNavigation.navigate(ROUTES.INBOX).SplitRouterdoes not dismiss or reset the central screen when navigating to the sidebar root (ROUTES.INBOX), keeping the staleREPORTroute active.ReportNotFoundGuardtriggers and displays the "Hmm... it's not here" screen.What changes do you think we should make in order to solve the problem?
Clear All Preserved Navigator States on Delegate Switch:
In
src/libs/actions/Delegate.ts:Replace calls to
clearPreservedSearchNavigatorStates()withclearPreservedNavigatorStates()in bothconnect()anddisconnect()so that cached split-navigator states (includingReportsSplitNavigator) are cleared across delegate boundaries:Reset Navigation to App Root on Delegate Transition:
Similar to the sign-out/session transition in
NavigationRoot.tsx, reset navigation state upon completingconnect()anddisconnect():This ensures that the tab bar and split navigators remount with fresh route keys and without stale
lastAccessedReportIDreferences from the previous session.Fallback in
SplitRouter/InboxTabButton:In
src/components/Navigation/NavigationTabBar/InboxTabButton.tsx, when the target report is not found in Onyx on wide layout, ensure the central screen is cleared or reset toROUTES.HOME/ first available report rather than leaving the inaccessible report mounted.What alternative solutions did you explore? (Optional)
ReportNavigateAwayHandler:ReportNavigateAwayHandlerchecks if the report is missing, but when unfocused or transitioning during account reload, it can fail to redirect before theReportNotFoundGuardmounts. A full navigation reset alongsideclearPreservedNavigatorStates()addresses the root cause deterministically.Contributor details:
Your Expensify account email: ashusatyarthi@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010e53044b5828fe60
bonnhatnguyen commentedon Sep 28, 2026
Please re-state the problem that we are trying to solve in this issue.
When a Copilot (User B) acts as another account (User A), opens a workspace chat, switches back to their own account, and navigates to the Inbox tab, a "Hmm... it's not here" (Not Here / 404) page appears instead of the user's normal Inbox chat list.
What is the root cause of that problem?
In
src/libs/actions/Delegate.ts:When switching between delegate and primary accounts (
connect()anddisconnect()/restoreDelegateSession()):Incomplete navigator state cleanup:
Lines 12, 137, and 201 call
clearPreservedSearchNavigatorStates():clearPreservedSearchNavigatorStates()was introduced in PR Submit query lingers on other member when switching accounts via copilot #73511 as a narrow fix for the Search tab. It purges keys starting withNAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR.However, it completely ignores all other split navigators, most notably
ReportsSplitNavigator(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR).As a result,
preservedNavigatorStatesinusePreserveNavigatorState.tsretains the entire route state ofReportsSplitNavigator, including User A's active workspace chatreportID.Re-attachment of inaccessible report state upon switching back:
clearOnyxForDelegateTransition()correctly wipes User A's Onyx report data.restoreTabNavigatorRoutesreattaches the cachedReportsSplitNavigatorstate frompreservedNavigatorStates.REPORTscreen with User A's workspace chatreportID.ReportNotFoundGuard(orReportScreen) triggers and renders the "Hmm... it's not here" error page.In contrast, full logout in
src/libs/Navigation/NavigationRoot.tsx(lines 140–145) explicitly callsclearPreservedNavigatorStates():Because a delegate account transition switches the authenticated account context just like a session change, failing to clear all preserved navigator states leaves stale route subtrees attached to the new session.
What changes do you think we should make in order to solve the problem?
In
src/libs/actions/Delegate.ts:Replace
clearPreservedSearchNavigatorStates()withclearPreservedNavigatorStates()in bothconnect()anddisconnect()/restoreDelegateSession():Reset Navigation root state on delegate transition:
In
src/libs/actions/Delegate.ts, callNavigation.resetToAppRoot()(orNavigation.reset(getStateToResetAfterLogout(navigationRef.getRootState()))) afterclearOnyxForDelegateTransition(). This forces all tab split navigators to remount with clean initial routes, dropping stalelastAccessedReportIDreferences from the previous user.In
src/libs/Navigation/AppNavigator/createSplitNavigator/usePreserveNavigatorState.ts:Deprecate/remove the now redundant
clearPreservedSearchNavigatorStatesexport in favor of canonicalclearPreservedNavigatorStates.Automated Unit Tests:
In
tests/unit/actions/DelegateTest.ts:usePreserveNavigatorState'spreservedNavigatorStateswith mock states forREPORTS_SPLIT_NAVIGATORandSEARCH_FULLSCREEN_NAVIGATOR.connect()/disconnect()and verifyclearPreservedNavigatorStates()is called, assertingpreservedNavigatorStatesis completely cleared across all navigator keys.What alternative solutions did you explore? (Optional)
REPORTS_SPLIT_NAVIGATORandSEARCH_FULLSCREEN_NAVIGATOR:Rejected because workspaces, settings, and other split navigators can also contain private policy or account routes accessible only to Account A (e.g. Issue [Exploratory] Copilot - Not Here page appears after switching user back and navigating to workspaces #98721 Copilot - Not Here page appears after switching user back and navigating to workspaces). Dropping all preserved states on delegate account switch guarantees security and UI consistency across all tabs.
Contributor details
Your Expensify account email: bonnhatnguyen0@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182
melvin-bot commentedon Sep 28, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
melvin-bot commentedon Oct 1, 2026
@eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
64 remaining items
mallenexpensify commentedon Nov 12, 2026
Payment Summary
Contributor+: @linhvovan29546 due $100 via NewDot
mallenexpensify commentedon Nov 12, 2026
@linhvovan29546 plz complete the Contributor+ checklist and tag me in a post once you have. Thx
linhvovan29546 commentedon Nov 13, 2026
No Checklist Needed
This issue was fixed in #106042, so no checklist is needed here.
linhvovan29546 commentedon Nov 13, 2026
@mallenexpensify Done
linhvovan29546 commentedon Nov 16, 2026
@mallenexpensify This should be $100 based on this summary: #102441 (comment)
mallenexpensify commentedon Nov 16, 2026
Thanks @linhvovan29546 , amount updated to $100
twisterdotcom commentedon Nov 17, 2026
$100 approved for @linhvovan29546 in Report ID: R00YISUXxump.
Zapier Logs
Run ID: 00040eee-8673-abad-8d1b-472db47fb824SO: https://stackoverflowteams.com/c/expensify/questions/7582