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-07-23] Android & iOS - Back button on Profile opens Profile after copilotting into agent #94088
Version Number: 9.4.16-1 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#93683 Email or phone of affected tester (no customers):sdjnoisdjdosijsonssjo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone 15 Pro Max / iOS 26.5 App Component: User Settings
Action Performed:
Precondition:
Create an agent in Account > Agents.
Launch Expensify app.
Go to Account > Agents.
Open any agent.
Click Copilot into account.
Click app back button.
Expected Result:
App back button will return to Account page.
Actual Result:
Back button on Profile opens Profile after copilotting into agent.
👋 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.
📣 @Dip-G-M! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
⚠️ Regression introduced by #93683 (the PR this deploy blocker was auto-assigned from). Not reproducible in production because the change only exists on staging.
Please re-state the problem that we are trying to solve in this issue.
After an owner copilots into one of their agents, the back button on the Profile page re-opens Profile instead of returning to the Account page — the user is trapped in a Profile ⇄ Profile loop.
What is the root cause of that problem?
#93683 changed withAgentAccessDenied to redirect agents off guarded screens on every focus via useFocusEffect, calling Navigation.navigate(ROUTES.SETTINGS_PROFILE) — see withAgentAccessDenied.tsx:28-35.
Navigation.navigate defaults to PUSH, not replace (linkTo/index.ts:181-189). So the redirect pushes a new Profile entry on top of the stale guarded central-pane screen (e.g. SCREENS.SETTINGS.AGENTS.ROOT) that the owner session left mounted in the SettingsSplitNavigator. The Account sidebar (SCREENS.SETTINGS.ROOT) is not guarded, but it sits below that guarded screen in the stack (SettingsSplitNavigator.tsx:16-29).
The loop:
Copilot in → session email becomes an agent; nav stack is not reset, so the owner's guarded central route stays mounted.
That guarded screen re-focuses → useFocusEffect fires → pushes Profile. Stack is now [Account sidebar] [Agents (guarded)] [Profile].
Back on Profile → pops to the still-guarded Agents screen → its useFocusEffect fires again → pushes Profile again. → loop, never reaching Account.
What changes do you think we should make in order to solve the problem?
Targeted fix (lowest risk): Make the redirect replace the guarded screen instead of pushing on top of it, by passing forceReplace at withAgentAccessDenied.tsx:33:
forceReplace is honored at linkTo/index.ts:173-175. This keeps #93683's blank-pane fix (still redirects on every focus) but consumes the stale guarded route, so back from Profile pops past it to the unguarded Account sidebar. ⚠️ Verify forceReplace propagates correctly through getMinimalAction's nested split-navigator drilldown so the REPLACE lands on the central-pane entry.
Alternatives considered
More robust: reinstate the (reverted) nav-stack reset in Delegate.connect/disconnect (src/libs/actions/Delegate.ts) so the owner's stale guarded routes are cleared at the source on every copilot transition, rather than relying on per-screen redirects. Best outcome is likely both — reset on connect/disconnect + keep the focus guard as a safety net.
Not recommended: keep PUSH but suppress the guard's re-fire with a transition flag — this reintroduces the blank-pane bug Redirect agents off guarded routes on every focus #93683 fixed, since the stale guarded screen would render its FullPageNotFoundView on back.
Fastest unblock: revert #93683 to clear the deploy blocker, then re-land with one of the fixes above.
Confidence: High — code evidence fully explains the symptom, the regression is isolated to the one file #93683 changed, and it matches "staging yes / production no."
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94088) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.35-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@abzokhattab The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Jun 19, 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/160685408d00b8dd1adc5bfd03f6c24955916184c3f0d05c4b2722911898ca6c
melvin-bot commentedon Jun 19, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #93683
melvin-bot commentedon Jun 19, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 19, 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:
Dip-G-M commentedon Jun 19, 2026
hi
melvin-bot commentedon Jun 19, 2026
📣 @Dip-G-M! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
MelvinBot commentedon Jun 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After an owner copilots into one of their agents, the back button on the Profile page re-opens Profile instead of returning to the Account page — the user is trapped in a Profile ⇄ Profile loop.
What is the root cause of that problem?
#93683 changed
withAgentAccessDeniedto redirect agents off guarded screens on every focus viauseFocusEffect, callingNavigation.navigate(ROUTES.SETTINGS_PROFILE)— seewithAgentAccessDenied.tsx:28-35.Navigation.navigatedefaults to PUSH, not replace (linkTo/index.ts:181-189). So the redirect pushes a new Profile entry on top of the stale guarded central-pane screen (e.g.SCREENS.SETTINGS.AGENTS.ROOT) that the owner session left mounted in theSettingsSplitNavigator. The Account sidebar (SCREENS.SETTINGS.ROOT) is not guarded, but it sits below that guarded screen in the stack (SettingsSplitNavigator.tsx:16-29).The loop:
useFocusEffectfires → pushes Profile. Stack is now[Account sidebar] [Agents (guarded)] [Profile].useFocusEffectfires again → pushes Profile again. → loop, never reaching Account.What changes do you think we should make in order to solve the problem?
Targeted fix (lowest risk): Make the redirect replace the guarded screen instead of pushing on top of it, by passing
forceReplaceatwithAgentAccessDenied.tsx:33:forceReplaceis honored atlinkTo/index.ts:173-175. This keeps #93683's blank-pane fix (still redirects on every focus) but consumes the stale guarded route, so back from Profile pops past it to the unguarded Account sidebar.forceReplacepropagates correctly throughgetMinimalAction's nested split-navigator drilldown so the REPLACE lands on the central-pane entry.Alternatives considered
Delegate.connect/disconnect(src/libs/actions/Delegate.ts) so the owner's stale guarded routes are cleared at the source on every copilot transition, rather than relying on per-screen redirects. Best outcome is likely both — reset on connect/disconnect + keep the focus guard as a safety net.FullPageNotFoundViewon back.Confidence: High — code evidence fully explains the symptom, the regression is isolated to the one file #93683 changed, and it matches "staging yes / production no."
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94088)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
mjasikowski commentedon Jun 20, 2026
@abzokhattab can you address this please?
17 remaining items
melvin-bot commentedon Jul 16, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.35-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-07-23. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 16, 2026
@abzokhattab The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Jul 20, 2026
@abzokhattab Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jul 22, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 22, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
abzokhattab commentedon Jul 23, 2026
Can we close this issue ,, the regression PR got merged and no payment is needed since it was handled in the main issue
cc @mjasikowski @mallenexpensify