[CP Staging] fix: gate chatReportID destination heuristic to per-diem only#92660
Conversation
PR 91266 added a heuristic in IOURequestStepConfirmation that redirected to report.chatReportID whenever report was a money-request report not currently topmost. That solved per-diem from a report preview (issue 91093) but over-fired for Manual/Scan/Distance: when a user changes the Report field to A on the confirm page, report becomes A and the heuristic sends them to A's parent chat instead of A (deploy blocker 92641). Gating the heuristic on isPerDiemRequest keeps the 91093 fix and restores pre-PR behavior for the other expense types.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@marcaaron Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🚧 @lakchote has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safaribefore: before.movafter: web.movregression test: from.money.request.report.movoriginal.issue.mov |
This comment was marked as outdated.
This comment was marked as outdated.
Crash analysis — confirmed a
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @lakchote has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
…rdiem-backtoreport-propagation [CP Staging] fix: gate chatReportID destination heuristic to per-diem only (cherry picked from commit 09cb9cb) (cherry-picked to staging by lakchote)
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.3.99-8 🚀
Bundle Size Analysis (Sentry): |
Help site review — no docs changes requiredI reviewed the changes in this PR against the help articles under What this PR changes It is a single-line, internal navigation bugfix in Why no documentation update is needed
Conclusion: No help site changes are required, so I have not created a draft docs PR. @MobileMage, please confirm this assessment that no |
|
Sorry for the delay, thank you for resolving this. |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.99-9 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.4.0-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: no changes required I reviewed the change in this PR against the help site files under What this PR does: It adds a single Why no docs update is needed: This is an internal navigation/routing fix. It does not introduce or change any user-facing feature, screen, copy, button label, tab name, or documented workflow. The relevant help articles (e.g. Per-Diem-Expenses.md, Add-an-expense.md) document how to create expenses and per diems; none of them describe the post-submit "which report opens" behavior that this PR corrects. The fix simply restores the pre-regression behavior, so existing documentation remains accurate. No draft help site PR was created because no @MobileMage, since this is a behavior-restoring bug fix with no user-facing or documented-workflow change, there's no help site PR to review. If you believe a specific article should be updated for this flow, let me know which one and I'll create the draft PR. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.0-7 🚀
|
Explanation of Change
PR #91266 added a heuristic in
IOURequestStepConfirmation.tsxthat redirecteddestinationReportIDtoreport.chatReportIDwheneverreportwas a money-request report not currently topmost. The intent was to handle per diem launched from a report preview's Add expense (#91093), wherebackToReportis set on the parent route but dropped by the per-diem step screens (STEP_DESTINATION,STEP_TIME,STEP_SUBRATEdon't carry it). The heuristic was not scoped, so other flows hit the same branch.In the deploy-blocker repro the user starts at the workspace chat, runs Manual, and on the confirm page changes the Report field to A:
backToReportisundefined(Manual from the workspace chat does not set it).reportbecomes Report A, soisMRReportistrue.getTopmostReportId() !== report.reportIDistrue.destinationReportIDtoreport.chatReportID— Report A's parent workspace chat — instead of Report A itself.The pre-insert and submit-dismiss flows then reveal that chat instead of Report A. Picking Create report in step 7 hits the same branch because the new report is also a money-request report.
This PR gates the heuristic on
isPerDiemRequest(already declared at line 144 of the same file), so the change is a single added condition. After the change:report?.reportIDexactly as they did before PR fix: per diem from report preview lands on workspace chat #91266 — the explicitly selected Report A opens.chatReportIDbranch, so the original fix is preserved.The matching
backToReport ?? activeReportIDchange inuseExpenseSubmission.tslives insidesubmitPerDiemExpenseand never runs for Manual / Scan / Distance, so it does not need to change for this fix.Fixed Issues
$ #92641
PROPOSAL: #92641 (comment)
Tests
Precondition: a workspace chat the user can post in, and the
+action available in the composer.+> Create expense > Manual.Offline tests
Same as Tests with the network disabled before each submission.
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Kapture.2026-06-04.at.13.47.48.mp4