Problem
In Spends → Reports, when opening a money request report and moving between reports with the next/previous controls, the report modal can dismiss unexpectedly and return the user to the reports list instead of staying on the selected report.
Cause
On SearchMoneyRequestReportPage, the screen stays mounted while reportIDFromRoute changes. The effect that treats a missing report as “removed” can run before Onyx has finished loading the new report. In that window the report looks absent, so the code incorrectly calls Navigation.dismissModal().
Expected
Arrow navigation should switch between reports without closing the modal or leaving the report flow.
Reproduction
- Use an account with multiple reports and expenses.
- Go to Spends → Reports.
- Open a report.
- Use next/previous several times.
- Before fix: you can be sent back to the reports list.
Fix
Fix modal dismiss on report route change in SearchMoneyRequestReportPage — guard the removal effect when the route report id just changed (e.g. usePrevious + early return) so a route transition is not mistaken for report deletion.
Note for PR author: #80560 linked in the PR “Fixed Issues” section is a different workstream (large-account tracking). After this issue is created, update the PR’s Fixed Issues to use this issue number instead.
Issue Owner
Current Issue Owner: @abzokhattab
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022049489947228713329
- Upwork Job ID: 2049489947228713329
- Last Price Increase: 2026-04-29
Problem
In Spends → Reports, when opening a money request report and moving between reports with the next/previous controls, the report modal can dismiss unexpectedly and return the user to the reports list instead of staying on the selected report.
Cause
On
SearchMoneyRequestReportPage, the screen stays mounted whilereportIDFromRoutechanges. The effect that treats a missing report as “removed” can run before Onyx has finished loading the new report. In that window the report looks absent, so the code incorrectly callsNavigation.dismissModal().Expected
Arrow navigation should switch between reports without closing the modal or leaving the report flow.
Reproduction
Fix
Fix modal dismiss on report route change in SearchMoneyRequestReportPage — guard the removal effect when the route report id just changed (e.g.
usePrevious+ early return) so a route transition is not mistaken for report deletion.Note for PR author: #80560 linked in the PR “Fixed Issues” section is a different workstream (large-account tracking). After this issue is created, update the PR’s Fixed Issues to use this issue number instead.
Issue Owner
Current Issue Owner: @abzokhattabUpwork Automation - Do Not Edit