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
[$250] Reports - Workspace chat link opens workspace chat with wrong UI when opened from Reports #72792
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Version Number: 9.2.32-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail:#72267 Email or phone of affected tester (no customers):djiofjnidfojdojoidfj@gmail.com Issue reported by: Applause - Internal Team
Action Performed:
Precondition:
Account has a workspace
Go to staging.new.expensify.com
Open FAB > Create expense > Manual
Submit an expense to any user (not workspace chat)
Open the expense report
Click More > Change workspace
Select a workspace
Go to Reports > Reports
Open the expense report
Click on the workspace link in "moved this report to the WORKSPACE LINK workspace"
Expected Result:
Workspace chat will open on Inbox because the link is a workspace chat link, not report link
Actual Result:
The workspace link opens the workspace chat on Reports, which leads to some abnormality that includes "This report has no expenses." in the workspace chat and the report preview appears as Comment section
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:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidenceBug6976545_1760616103118.Screen_Recording_2025-10-16_at_19.51.33.mp4
Please re-state the problem that we are trying to solve in this issue.
Workspace chat links opened from the Reports page incorrectly open in the Reports context instead of Inbox, causing UI issues like "This report has no expenses" appearing in workspace chats.
When clicking a workspace chat link from the Reports page, the function returns a search-context URL for the workspace chat
Workspace chats are not designed to work in the Reports/Search context, which causes the UI abnormalities
What changes do you think we should make in order to solve the problem?
update the getReportURLForCurrentContext function: here
Retrieve the report data for the given reportID using getReportOrDraftReport
Check if the report is a workspace chat using isPolicyExpenseChat
If the report is a workspace chat, always return the standard Inbox route (ROUTES.REPORT_WITH_ID.getRoute(reportID)) regardless of the current navigation context
For non-workspace chats, maintain the existing behavior of preserving the search context when applicable
This ensures workspace chats always open in Inbox where they function correctly, while other reports continue to work as expected in the Reports page.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
update the getReportURLForCurrentContext test cases inside the ReportUtilsTest file to include a test for this case
it('returns Inbox route for workspace chat even when in search context',async()=>{// Create a workspace chat reportconstworkspaceChatReportID='999';constworkspaceChat: Report={
...createRandomReport(999),reportID: workspaceChatReportID,chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT,isOwnPolicyExpenseChat: true,type: CONST.REPORT.TYPE.CHAT,};// Set up Onyx with the workspace chatawaitOnyx.set(`${ONYXKEYS.COLLECTION.REPORT}${workspaceChatReportID}`,workspaceChat);awaitflushPromises();// Mock being in search contextmockIsSearchTopmostFullScreenRoute.mockReturnValue(true);mockGetActiveRoute.mockReturnValue('search?q=type:report');// Even in search context, workspace chats should return Inbox routeexpect(getReportURLForCurrentContext(workspaceChatReportID)).toBe(`${environmentURL}/${ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID)}`);// Clean upawaitOnyx.clear();});
What alternative solutions did you explore? (Optional)
changed the title [-]Reports - Workspace chat link opens workspace chat with wrong UI when opened from Reports[/-][+][$250] Reports - Workspace chat link opens workspace chat with wrong UI when opened from Reports[/+]on Oct 17, 2025
Please re-state the problem that we are trying to solve in this issue.
Workspace links inside the "moved this report to the WORKSPACE workspace" system message should open the workspace chat inside the Inbox view. Following that link after moving an expense report keeps the app on the Reports split view and shows a wrong UI.
What is the root cause of that problem?
getReportURLForCurrentContext always returns the search-context URL when the current route is search, even for workspace chats. When a user clicks the system message inside Reports, the navigation stays in that context and we render the workspace chat in the wrong pane.
What changes do you think we should make in order to solve the problem?
Detect when the target report is a policyExpenseChat and bypass the search-specific route builder, updating navigation to the regular /r/:reportID route. This moves workspace chats into the central Inbox pane regardless of where the link was clicked.
We should also update tests/unit/ReportUtilsTest.ts to assert that policyExpenseChat links now bypass the search URL.
New unit test can be added:
it('opens workspace chats outside of the search context',async()=>{constreportID='workspaceChatReportID';mockIsSearchTopmostFullScreenRoute.mockReturnValue(true);mockGetActiveRoute.mockReturnValue('search?q=type:report');awaitOnyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`,{
reportID,chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT,});awaitflushPromises();expect(getReportURLForCurrentContext(reportID)).toBe(`${environmentURL}/${ROUTES.REPORT_WITH_ID.getRoute(reportID)}`);awaitOnyx.clear();});
getReportURLForCurrentContext returns the URL depends on whether the user is on Reports tab or not. If true, then it will return the search money request report page URL.
What changes do you think we should make in order to solve the problem?
getReportURLForCurrentContext already does it job well, what we need is to remove the usage of getReportURLForCurrentContext when building the workspace URL (newParentReportUrl).
For movedReportUrl, it will only be used if shouldHideMovedReportUrl is false, which is true inside the DM (when we move from DM to WS, the DM will also receive the MOVED action).
There is no way to access the DM chat from the Reports > Reports tab, but we can still access it from Reports > Chats.
If we don't want it to open on search money request report, then we can also apply the same fix to movedReportUrl.
📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Activity
melvin-bot commentedon Oct 16, 2025
Triggered auto assignment to @NicMendonca (
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.abzokhattab commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace chat links opened from the Reports page incorrectly open in the Reports context instead of Inbox, causing UI issues like "This report has no expenses" appearing in workspace chats.
What is the root cause of that problem?
getReportURLForCurrentContextfunction generates URLs that preserve the current navigation context (Reports/Search)What changes do you think we should make in order to solve the problem?
update the
getReportURLForCurrentContextfunction:here
reportIDusinggetReportOrDraftReportisPolicyExpenseChatROUTES.REPORT_WITH_ID.getRoute(reportID)) regardless of the current navigation contextThis ensures workspace chats always open in Inbox where they function correctly, while other reports continue to work as expected in the Reports page.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
update the
getReportURLForCurrentContexttest cases inside theReportUtilsTestfile to include a test for this caseWhat alternative solutions did you explore? (Optional)
NA
[-]Reports - Workspace chat link opens workspace chat with wrong UI when opened from Reports[/-][+][$250] Reports - Workspace chat link opens workspace chat with wrong UI when opened from Reports[/+]melvin-bot commentedon Oct 17, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021979254999259299084
melvin-bot commentedon Oct 17, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (
External)ShridharGoel commentedon Oct 19, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace links inside the "moved this report to the WORKSPACE workspace" system message should open the workspace chat inside the Inbox view. Following that link after moving an expense report keeps the app on the Reports split view and shows a wrong UI.
What is the root cause of that problem?
getReportURLForCurrentContextalways returns the search-context URL when the current route is search, even for workspace chats. When a user clicks the system message inside Reports, the navigation stays in that context and we render the workspace chat in the wrong pane.App/src/libs/ReportUtils.ts
Lines 11975 to 12021 in 7165a14
What changes do you think we should make in order to solve the problem?
Detect when the target report is a
policyExpenseChatand bypass the search-specific route builder, updating navigation to the regular/r/:reportIDroute. This moves workspace chats into the central Inbox pane regardless of where the link was clicked.The updated code looks like this:
We should also update
tests/unit/ReportUtilsTest.tsto assert thatpolicyExpenseChatlinks now bypass the search URL.New unit test can be added:
bernhardoj commentedon Oct 20, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
WS chat link from MOVED action message opens the WS chat within Reports page.
What is the root cause of that problem?
The MOVED action message is built from this function and the link is from
getReportURLForCurrentContext.App/src/libs/ReportUtils.ts
Lines 6524 to 6528 in cc0751e
getReportURLForCurrentContextreturns the URL depends on whether the user is on Reports tab or not. If true, then it will return the search money request report page URL.App/src/libs/ReportUtils.ts
Lines 12019 to 12020 in cc0751e
What changes do you think we should make in order to solve the problem?
getReportURLForCurrentContextalready does it job well, what we need is to remove the usage ofgetReportURLForCurrentContextwhen building the workspace URL (newParentReportUrl).App/src/libs/ReportUtils.ts
Lines 6524 to 6528 in cc0751e
For
movedReportUrl, it will only be used ifshouldHideMovedReportUrlis false, which is true inside the DM (when we move from DM to WS, the DM will also receive the MOVED action).There is no way to access the DM chat from the Reports > Reports tab, but we can still access it from Reports > Chats.
If we don't want it to open on search money request report, then we can also apply the same fix to
movedReportUrl.Krishna2323 commentedon Oct 21, 2025
I will review the proposals today if possible, or tomorrow for sure.
14 remaining items
melvin-bot commentedon Oct 30, 2025
📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
abzokhattab commentedon Oct 30, 2025
PR is ready #73884
cc @Krishna2323
puneetlath commentedon Nov 13, 2025
@NicMendonca FYI we are no longer going forward with this PR but should go ahead and pay the issue out. Context: #73884 (comment)
Krishna2323 commentedon Nov 24, 2025
@NicMendonca could you please post the payment summary when you get a chance? Thanks!
NicMendonca commentedon Nov 27, 2025
Payment Summary
Contributor: @abzokhattab due $250 via NewDot
Contributor+: @Krishna2323 due $250 via NewDot
garrettmknight commentedon Dec 1, 2025
$250 approved for @abzokhattab
Krishna2323 commentedon Dec 6, 2025
Requested in ND.
quinthar commentedon Dec 8, 2025
Approved $250 to @Krishna2323