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 2025-10-22] [Due for payment 2025-10-03] [$250] Clicking Report Link in Report History Navigates to Inbox Instead of Reports Page #70509
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Version Number: 9.2.13-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@puneetlath Slack conversation (hyperlinked to channel name): #Expensify Migrate
Action Performed:
Precondition: User have an expense moved from one report to other
Go to the Reports > Expense page
Open an expense and scroll to its report history
Click on the report link from the moved this expense thread
Observe the navigation behavior
Expected Result:
The clicked link should open in the Reports page context
Actual Result:
The clicked link opens in the Inbox instead.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Result:
Screen.Recording.2025-09-13.at.06.45.55.mov
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
When viewing an expense in Reports > Expenses, clicking the report link inside the "moved this expense" message opens the target in the Inbox context instead of staying within Reports. Users expect navigation to remain in the Reports context when the action originates from there.
What is the root cause of that problem?
The HTML for the moved-expense/moved-report messages hardcodes links to the Inbox route schema /r/:reportID. These links are generated in src/libs/ReportUtils.ts without considering whether the user is currently viewing Reports (Search) or Inbox.
? `moved this <a href='${CONST.NEW_EXPENSIFY_URL}r/${movedReportID}' target='_blank' rel='noreferrer noopener'>report</a> to the <a href='${CONST.NEW_EXPENSIFY_URL}r/${newParentReportID}' target='_blank' rel='noreferrer noopener'>${policyName}</a> workspace`
: `moved this report to the <a href='${CONST.NEW_EXPENSIFY_URL}r/${newParentReportID}' target='_blank' rel='noreferrer noopener'>${policyName}</a> workspace`,
text: `moved this report to the ${policyName} workspace`,
type: CONST.REPORT.MESSAGE.TYPE.COMMENT,
},
];
Because these anchors point to /r/:id, clicking them navigates to the Inbox stack even when clicked from Reports.
What changes do you think we should make in order to solve the problem?
Introduce a small helper in ReportUtils that builds a report URL based on the current navigation context. We reuse the same context-detection used by other working links (e.g., the top-right "From Expense Report …" link), by checking whether the Search full-screen navigator is topmost via isSearchTopmostFullScreenRoute().
Then, update all moved-expense/moved-report message builders to use this helper, so:
When the user is in Reports (Search), links point to search/r/:reportID (Reports context).
Otherwise, links point to r/:reportID (Inbox context).
Updated snippets in src/libs/ReportUtils.ts:
// Centralized URL builder used by message generatorsfunctiongetReportURLForCurrentContext(reportID: string|number|undefined): string{constid=String(reportID??'');if(!id){return`${environmentURL}/r/`;}constisInSearchContext=isSearchTopmostFullScreenRoute();constrelativePath=isInSearchContext
? ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: id})
: ROUTES.REPORT_WITH_ID.getRoute(id);return`${environmentURL}/${relativePath}`;}
// 1) Moved transaction messagefunctiongetMovedTransactionMessage(report: OnyxEntry<Report>){constreportName=getReportName(report)??report?.reportName??'';constreportUrl=getReportURLForCurrentContext(report?.reportID);returntranslateLocal('iou.movedTransaction',{reportUrl, reportName});}
// 3) Optimistic moved transaction message HTMLfunctionbuildOptimisticTransactionAction(/* ... */){constreportName=allReports?.[targetReportID]?.reportName??'';consturl=getReportURLForCurrentContext(targetReportID);const[actionText,messageHtml]=[`moved this expense to ${reportName}`,`moved this expense to <a href='${url}' target='_blank' rel='noreferrer noopener'>${reportName}</a>`,];// ...}
// 4) Optimistic moved report message HTML (used when moving reports across workspaces)constmovedActionMessage=[{html: shouldHideMovedReportUrl
? `moved this <a href='${getReportURLForCurrentContext(movedReportID)}' target='_blank' rel='noreferrer noopener'>report</a> to the <a href='${getReportURLForCurrentContext(newParentReportID)}' target='_blank' rel='noreferrer noopener'>${policyName}</a> workspace`
: `moved this report to the <a href='${getReportURLForCurrentContext(newParentReportID)}' target='_blank' rel='noreferrer noopener'>${policyName}</a> workspace`,text: `moved this report to the ${policyName} workspace`,type: CONST.REPORT.MESSAGE.TYPE.COMMENT,},];
This mirrors the successful behavior of the existing parent-navigation subtitle link, so clicking the report link in the message now stays in Reports when the user is already there, and stays in Inbox when originating from Inbox.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
When isSearchTopmostFullScreenRoute() returns true, getReportURLForCurrentContext('123') builds .../search/r/123.
When it returns false, the helper builds .../r/123. etc.
changed the title [-]Clicking Report Link in Report History Navigates to Inbox Instead of Reports Page[/-][+][$250] Clicking Report Link in Report History Navigates to Inbox Instead of Reports Page[/+]on Sep 15, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.31-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ikevin127 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]
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A - Result of the original design
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition: User has an expense moved from one report to another.
Go to the Reports > Expense page.
Open an expense and scroll to its report history.
Click on the report link from the moved this expense thread.
Verify that the report link opens within the Reports page.
Issue is ready for payment but no BZ is assigned. @dylanexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Activity
melvin-bot commentedon Sep 12, 2025
Triggered auto assignment to @laurenreidexpensify (
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.daledah commentedon Sep 12, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The clicked link opens in the Inbox instead.
What is the root cause of that problem?
We always redirect to report here
App/src/libs/ReportUtils.ts
Lines 6304 to 6311 in 3938e13
What changes do you think we should make in order to solve the problem?
We should check if
isSearchTopmostFullScreenRouteis true, we should show it in the Reports PageIn case we only want to navigate to Reports Page if the RHP is open, we can use
Note: we can do the same with other moved messages like getMovedTransactionMessage, getMovedActionMessage, ...
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Result:
Screen.Recording.2025-09-13.at.06.45.55.mov
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
ShridharGoel commentedon Sep 13, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing an expense in Reports > Expenses, clicking the report link inside the "moved this expense" message opens the target in the Inbox context instead of staying within Reports. Users expect navigation to remain in the Reports context when the action originates from there.
What is the root cause of that problem?
The HTML for the moved-expense/moved-report messages hardcodes links to the Inbox route schema
/r/:reportID. These links are generated insrc/libs/ReportUtils.tswithout considering whether the user is currently viewing Reports (Search) or Inbox.App/src/libs/ReportUtils.ts
Lines 6294 to 6302 in 3938e13
App/src/libs/ReportUtils.ts
Lines 6313 to 6330 in 3938e13
App/src/libs/ReportUtils.ts
Lines 6733 to 6770 in 3938e13
App/src/libs/ReportUtils.ts
Lines 6648 to 6656 in 3938e13
Because these anchors point to
/r/:id, clicking them navigates to the Inbox stack even when clicked from Reports.What changes do you think we should make in order to solve the problem?
Introduce a small helper in
ReportUtilsthat builds a report URL based on the current navigation context. We reuse the same context-detection used by other working links (e.g., the top-right "From Expense Report …" link), by checking whether the Search full-screen navigator is topmost viaisSearchTopmostFullScreenRoute().Then, update all moved-expense/moved-report message builders to use this helper, so:
search/r/:reportID(Reports context).r/:reportID(Inbox context).Updated snippets in
src/libs/ReportUtils.ts:This mirrors the successful behavior of the existing parent-navigation subtitle link, so clicking the report link in the message now stays in Reports when the user is already there, and stays in Inbox when originating from Inbox.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
isSearchTopmostFullScreenRoute()returns true,getReportURLForCurrentContext('123')builds.../search/r/123..../r/123. etc.[-]Clicking Report Link in Report History Navigates to Inbox Instead of Reports Page[/-][+][$250] Clicking Report Link in Report History Navigates to Inbox Instead of Reports Page[/+]melvin-bot commentedon Sep 15, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021967521875052853454
melvin-bot commentedon Sep 15, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)62 remaining items
melvin-bot commentedon Oct 15, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 15, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.31-2 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 2025-10-22. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 15, 2025
@ikevin127 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]
ShridharGoel commentedon Oct 18, 2025
@laurenreidexpensify I'll be requesting via ND, once this is due for payment. Thanks.
ikevin127 commentedon Oct 18, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A - Result of the original design
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition: User has an expense moved from one report to another.
Do we agree 👍 or 👎.
melvin-bot commentedon Oct 22, 2025
Issue is ready for payment but no BZ is assigned. @dylanexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
laurenreidexpensify commentedon Oct 23, 2025
Summary
C+ $250 can request payment in Expensify @ikevin127
Contributor $250 can request payment in Expensify @ShridharGoel
garrettmknight commentedon Oct 24, 2025
$250 approved for @ikevin127
ShridharGoel commentedon Oct 28, 2025
@garrettmknight Can you check mine as well?
garrettmknight commentedon Oct 29, 2025
$250 approved for @ShridharGoel