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
Navigation is repeated when returning from per diem confirm page after changing report #82873
Version Number: 9.3.22-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:#81942 Email or phone of affected tester (no customers):sdjnisodjodijiosj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Create two workspaces - A and B.
Import per diem rates to both workspaces (can use the same per diem rates).
Go to staging.new.expensify.com
Create two reports in workspace A and B.
Open FAB > Create expense > Per diem.
Select any workspace.
Select any details and reach confirm page.
On confirm page, click Report.
Select report from the other workspace.
On confirm page, click RHP back button three times.
Click RHP back button again.
Expected Result:
RHP will return to per diem initial page.
Actual Result:
RHP reopens subrate page, then back button returns to time and destination page
👋 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.
Please re-state the problem that we are trying to solve in this issue.
When creating a per diem expense from global create (FAB), selecting a workspace, filling in details (destination, time, subrates), and reaching the confirm page, if the user changes the report to one from a different workspace and then presses the RHP back button, the navigation repeats -- the subrate page reopens, then pressing back shows the time and destination pages again, instead of returning to the per diem initial page.
What is the root cause of that problem?
PR #81942 changed selectedPolicyID to undefined for per diem from global create at IOURequestStepReport.tsx:265, enabling cross-workspace report selection. When a user selects a report from a different workspace, handleGlobalCreateReport (lines 99-147) detects the policy changed, clears subrates, resets the customUnitID/rateID, then navigates back to the confirmation page via Navigation.goBack(iouConfirmationPageRoute, {compareParams: false}).
The POP_TO action updates the confirmation page's reportID param to the new workspace's chatReportID, but the per diem step routes below on the stack (Destination, Time, Subrate) still have the old reportID from the original workspace.
When the user presses back from the confirmation page, navigateBack at IOURequestStepConfirmation.tsx:438 calls Navigation.goBack(ROUTES.MONEY_REQUEST_STEP_SUBRATE.getRoute(..., reportID)) with the new reportID. The goUp function at Navigation.ts:430 searches the stack for a subrate route with the new reportID but only finds one with the old reportID. Since compareParams defaults to true, there's no match (indexOfBackToRoute === -1), so goUp dispatches a REPLACE action (line 435) instead of popping. This replaces the current screen with a new subrate screen while the old per diem step screens remain below, creating duplicate screens and a navigation loop.
The stack evolves like this:
Before report change: [Start, Destination(A), Time(A), Subrate(A), Confirmation(A)]
After report change: [Start, Destination(A), Time(A), Subrate(A), Confirmation(B)]
Back from confirmation: [Start, Destination(A), Time(A), Subrate(A), Subrate(B)] (REPLACE instead of POP)
Back from subrate(B): [Start, Destination(A), Time(A), Subrate(A), Time(B)] (REPLACE again)
What changes do you think we should make in order to solve the problem?
The fix should be in handleGlobalCreateReport in IOURequestStepReport.tsx. When the policy changes for a per diem transaction from global create, instead of just navigating back to the confirmation page (which leaves stale routes with old reportIDs on the stack), the navigation should go back further to the per diem start/destination step to force the user through the per diem flow again with the new workspace context. This is appropriate because clearSubrates already wipes the per diem data, so the user needs to re-enter destination, time, and subrates for the new workspace anyway.
Alternatively, the navigateBack call in IOURequestStepConfirmation.tsx:438 for per diem could use {compareParams: false} when calling Navigation.goBack for the subrate step, so it matches the existing subrate route by screen name regardless of the reportID param. However, this would still leave the user on an empty subrate page since subrates were cleared.
What alternative solutions did you explore? (Optional)
Another approach would be to not clear the subrates at all when the workspace changes and instead attempt to map the per diem data to the new workspace's custom units. However, this would be more complex and may not be correct if the destination workspaces have different per diem rate structures.
handleGlobalCreateReport (IOURequestStepReport.tsx:134-143): When policyChanged && isPerDiemTransaction, calls clearSubrates, setCustomUnitID, setCustomUnitRateID(undefined), then Navigation.goBack(iouConfirmationPageRoute, {compareParams: false}).
goUp with compareParams: false (Navigation.ts:430-444): POP_TO finds confirmation route by name (ignoring params), pops report-step screen, updates confirmation params. Old per diem routes below remain untouched.
Confirmation navigateBack (IOURequestStepConfirmation.tsx:438): Navigation.goBack(ROUTES.MONEY_REQUEST_STEP_SUBRATE.getRoute(action, iouType, initialTransactionID, reportID)) -- uses new reportID from updated route params.
goUp with default compareParams: true (Navigation.ts:430): Searches for subrate route with new reportID, doesn't find it (old reportID on stack), indexOfBackToRoute === -1, dispatches REPLACE instead of POP.
Cascading REPLACE actions: Each back press creates a REPLACE with the new reportID for the next per diem step, while old steps remain on the stack, creating the repeating navigation.
Relevant Code
App/src/pages/iou/request/step/IOURequestStepReport.tsx:99-147 - handleGlobalCreateReport (clears data + navigates)
Activity
melvin-bot commentedon Feb 18, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #81942
melvin-bot commentedon Feb 18, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 18, 2026
Triggered auto assignment to @lydiabarclay (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.github-actions commentedon Feb 18, 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:
MelvinBot commentedon Feb 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating a per diem expense from global create (FAB), selecting a workspace, filling in details (destination, time, subrates), and reaching the confirm page, if the user changes the report to one from a different workspace and then presses the RHP back button, the navigation repeats -- the subrate page reopens, then pressing back shows the time and destination pages again, instead of returning to the per diem initial page.
What is the root cause of that problem?
PR #81942 changed
selectedPolicyIDtoundefinedfor per diem from global create atIOURequestStepReport.tsx:265, enabling cross-workspace report selection. When a user selects a report from a different workspace,handleGlobalCreateReport(lines 99-147) detects the policy changed, clears subrates, resets the customUnitID/rateID, then navigates back to the confirmation page viaNavigation.goBack(iouConfirmationPageRoute, {compareParams: false}).The
POP_TOaction updates the confirmation page'sreportIDparam to the new workspace's chatReportID, but the per diem step routes below on the stack (Destination, Time, Subrate) still have the old reportID from the original workspace.When the user presses back from the confirmation page,
navigateBackatIOURequestStepConfirmation.tsx:438callsNavigation.goBack(ROUTES.MONEY_REQUEST_STEP_SUBRATE.getRoute(..., reportID))with the new reportID. ThegoUpfunction atNavigation.ts:430searches the stack for a subrate route with the new reportID but only finds one with the old reportID. SincecompareParamsdefaults totrue, there's no match (indexOfBackToRoute === -1), sogoUpdispatches a REPLACE action (line 435) instead of popping. This replaces the current screen with a new subrate screen while the old per diem step screens remain below, creating duplicate screens and a navigation loop.The stack evolves like this:
[Start, Destination(A), Time(A), Subrate(A), Confirmation(A)][Start, Destination(A), Time(A), Subrate(A), Confirmation(B)][Start, Destination(A), Time(A), Subrate(A), Subrate(B)](REPLACE instead of POP)[Start, Destination(A), Time(A), Subrate(A), Time(B)](REPLACE again)What changes do you think we should make in order to solve the problem?
The fix should be in
handleGlobalCreateReportinIOURequestStepReport.tsx. When the policy changes for a per diem transaction from global create, instead of just navigating back to the confirmation page (which leaves stale routes with old reportIDs on the stack), the navigation should go back further to the per diem start/destination step to force the user through the per diem flow again with the new workspace context. This is appropriate becauseclearSubratesalready wipes the per diem data, so the user needs to re-enter destination, time, and subrates for the new workspace anyway.Alternatively, the
navigateBackcall inIOURequestStepConfirmation.tsx:438for per diem could use{compareParams: false}when callingNavigation.goBackfor the subrate step, so it matches the existing subrate route by screen name regardless of the reportID param. However, this would still leave the user on an empty subrate page since subrates were cleared.What alternative solutions did you explore? (Optional)
Another approach would be to not clear the subrates at all when the workspace changes and instead attempt to map the per diem data to the new workspace's custom units. However, this would be more complex and may not be correct if the destination workspaces have different per diem rate structures.
Detailed Investigation
Evidence Chain
PR fix: report from the other workspace doesn't appear in the report field #81942 change (
IOURequestStepReport.tsx:265):selectedPolicyID = isFromGlobalCreate ? undefined : perDiemOriginalPolicy?.id-- enables cross-workspace report selection for per diem from FAB.handleGlobalCreateReport(IOURequestStepReport.tsx:134-143): WhenpolicyChanged && isPerDiemTransaction, callsclearSubrates,setCustomUnitID,setCustomUnitRateID(undefined), thenNavigation.goBack(iouConfirmationPageRoute, {compareParams: false}).goUpwithcompareParams: false(Navigation.ts:430-444): POP_TO finds confirmation route by name (ignoring params), pops report-step screen, updates confirmation params. Old per diem routes below remain untouched.Confirmation
navigateBack(IOURequestStepConfirmation.tsx:438):Navigation.goBack(ROUTES.MONEY_REQUEST_STEP_SUBRATE.getRoute(action, iouType, initialTransactionID, reportID))-- uses new reportID from updated route params.goUpwith defaultcompareParams: true(Navigation.ts:430): Searches for subrate route with new reportID, doesn't find it (old reportID on stack),indexOfBackToRoute === -1, dispatches REPLACE instead of POP.Cascading REPLACE actions: Each back press creates a REPLACE with the new reportID for the next per diem step, while old steps remain on the stack, creating the repeating navigation.
Relevant Code
App/src/pages/iou/request/step/IOURequestStepReport.tsx:99-147- handleGlobalCreateReport (clears data + navigates)App/src/pages/iou/request/step/IOURequestStepReport.tsx:263-268- selectedPolicyID computation (PR fix: report from the other workspace doesn't appear in the report field #81942 change)App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx:433-439- navigateBack for per diemApp/src/libs/Navigation/Navigation.ts:405-448- goUp function (POP_TO vs REPLACE logic)App/src/libs/Navigation/Navigation.ts:344-361- doesRouteMatchToMinimalActionPayload (param comparison)App/src/hooks/useOutstandingReports.ts:24-34- Returns all-workspace reports when selectedPolicyID is undefinedApp/src/ROUTES.ts:1062-1097- Per diem step route definitions with :reportID paramNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.izarutskaya commentedon Feb 19, 2026
QA team can't reproduce the issue as workspace B is not displayed in report field list
Build 9.3.22-2
Windows 11 / Chrome
Recording.3646.mp4
Screen.Recording.2026-02-19.at.14.49.08.mp4
Samsung A52 / Android 14
Build 9.3.22-2
per.diemm.mp4
iPhone 14Pro Max
iOS 26.2.1
Screenrecording.02-19-2026.3-08-05.Pm.1.mp4
MarioExpensify commentedon Feb 19, 2026
Thank you @izarutskaya. Closing this one - will be fixed in the original issue.