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-05-29] Agent - Not so far page opens on the first copilot into the agent account. #91145
Version Number: v9.3.78-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#90371 Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 15.4.1 Safari/Chrome App Component: User Settings
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
changed the title [-]PR 90371 - Agent - Not so far page opens on the first copilot into the agent account.[/-][+]Agent - Not so far page opens on the first copilot into the agent account.[/+]on May 20, 2026
When copiloting into an agent account, connect() clears Onyx data via clearOnyxForDelegateTransition() but does not reset the React Navigation state. The in-memory preservedNavigatorStates remain intact — only search navigator states are cleared (line 202).
If the user was viewing /settings/agents/ before switching, the SplitRouter restores AGENTS.ROOT from previousSelectedCentralScreen instead of falling back to the defaultCentralScreen (Profile). Since PR #90371 wrapped that screen with withAgentAccessDenied, the agent session email triggers DelegateNoAccessWrapper to render the "Not so fast..." page.
The sidebar correctly hides the Agents menu item for agent accounts (InitialSettingsPage.tsx:318), but the central pane still shows the stale route.
What changes do you think we should make in order to solve the problem?
In Delegate.ts, clear all preserved navigator states (not just search) during connect() and disconnect(). This way the SplitRouter falls back to defaultCentralScreen (Profile) after the delegate transition, avoiding stale routes that are now access-denied.
Concretely: add and call a clearAllPreservedNavigatorStates() function in usePreserveNavigatorState.ts that empties the entire preservedNavigatorStates record. Call it in connect() and disconnect() in place of (or in addition to) clearPreservedSearchNavigatorStates().
What alternative solutions did you explore?
An alternative would be to navigate explicitly to /settings/profile after the delegate transition completes. However, clearing all preserved states is more robust — it prevents any stale route from persisting across account switches, not just the agents route.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
it actually works? The idea is you cannot see the agents page anymore, so this is intended, we could redirect to the agent profile if the page isn't accessible or something else but the functionality isn't broken it might need polishing tho.
@mallenexpensify Just realised that this is pending for payment, can you have a look? This was before joining the BE team, no BE hours were spent on this.
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
Activity
applause-bot commentedon May 20, 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/ac03b97082a36240fcadb35a64eaf33d3fa8b4645ea8cfa7588bbfb5cffb1224
melvin-bot commentedon May 20, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #90371
melvin-bot commentedon May 20, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 20, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
[-]PR 90371 - Agent - Not so far page opens on the first copilot into the agent account.[/-][+]Agent - Not so far page opens on the first copilot into the agent account.[/+]MelvinBot commentedon May 20, 2026
Proposal
What is the root cause of that problem?
When copiloting into an agent account,
connect()clears Onyx data viaclearOnyxForDelegateTransition()but does not reset the React Navigation state. The in-memorypreservedNavigatorStatesremain intact — only search navigator states are cleared (line 202).If the user was viewing
/settings/agents/before switching, theSplitRouterrestoresAGENTS.ROOTfrompreviousSelectedCentralScreeninstead of falling back to thedefaultCentralScreen(Profile). Since PR #90371 wrapped that screen withwithAgentAccessDenied, the agent session email triggersDelegateNoAccessWrapperto render the "Not so fast..." page.The sidebar correctly hides the Agents menu item for agent accounts (
InitialSettingsPage.tsx:318), but the central pane still shows the stale route.What changes do you think we should make in order to solve the problem?
In
Delegate.ts, clear all preserved navigator states (not just search) duringconnect()anddisconnect(). This way theSplitRouterfalls back todefaultCentralScreen(Profile) after the delegate transition, avoiding stale routes that are now access-denied.Concretely: add and call a
clearAllPreservedNavigatorStates()function inusePreserveNavigatorState.tsthat empties the entirepreservedNavigatorStatesrecord. Call it inconnect()anddisconnect()in place of (or in addition to)clearPreservedSearchNavigatorStates().What alternative solutions did you explore?
An alternative would be to navigate explicitly to
/settings/profileafter the delegate transition completes. However, clearing all preserved states is more robust — it prevents any stale route from persisting across account switches, not just the agents route.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.NicolasBonet commentedon May 20, 2026
This isn't a bug, this is intended:
This is also behind a beta, so not a blocker
22 remaining items
ShridharGoel commentedon Jul 14, 2026
@mallenexpensify Just realised that this is pending for payment, can you have a look? This was before joining the BE team, no BE hours were spent on this.
melvin-bot commentedon Jul 14, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 14, 2026
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.
mallenexpensify commentedon Jul 15, 2026
Payment Summary
Contributor+: @ShridharGoel due $250 via NewDot
garrettmknight commentedon Jul 19, 2026
$250 apprvoed for @ShridharGoel