Skip to content

[Due for payment 2026-03-25] Workspace - Non-existing room mention shows green highlight after saving description #85363

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.38-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #55846
Email or phone of affected tester (no customers): sdijnsoijsodosj@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:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Overview.
  3. Click Description.
  4. Enter a room mention which does not exist (eg, #abc).
  5. Click Save.

Expected Result:

#abc mention will not show green highlight after saving the description because #abc is not an existing room.

Actual Result:

#abc mention shows green highlight briefly after saving the description.
Green highlight indicates the currently opened room, which is not the case as workspace overview is opened.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7104076_1773656732105.5.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Mar 16, 2026
  2. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #55846

  3. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Mar 16, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Mar 16, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #55846 - "fix: the mentioned room is not highlighted in policy profile page" by @truph01 (High confidence)
    Related Issues: #54941 (original issue that PR #55846 fixed)

    Recommendation: REVERT

    PR #55846 introduced a regression where non-existing room mentions incorrectly show the green highlight (indicating the currently opened room) when saved in workspace descriptions. This happens because the PR sets currentReportID: undefined in the mention context, and non-existing rooms also have reportID: undefined, causing an unintended match (undefined === undefined).

    Labels: Removing DeployBlocker label - this is a frontend/App issue that blocks the App deploy only.

    📋 Detailed Analysis

    Evidence

    PR #55846 was intended to fix issue #54941 where room mentions were not highlighted in workspace descriptions. The PR added policyID context to enable room mention highlighting.

    However, it introduced a regression visible in the reproduction steps:

    1. When a non-existing room mention (e.g., #abc) is entered in workspace description
    2. After saving, the mention briefly shows green highlight
    3. Green highlight indicates "currently opened room", which is incorrect since workspace overview is open, not #abc

    Verification

    The bug is in the interaction between these changes:

    File: src/pages/workspace/WorkspaceOverviewPage.tsx (line 197)

    const mentionReportContextValue = {policyID: policy?.id, currentReportID: undefined};

    File: src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer/index.tsx (line 51)

    const isCurrentRoomMention = reportID === currentReportIDValue;

    File: src/libs/MentionUtils.ts (lines 27-32)
    For non-existing rooms, the loop finds no match, so reportID remains undefined.

    Root Cause

    The comparison reportID === currentReportIDValue evaluates to undefined === undefined = true when:

    • currentReportIDValue is undefined (set explicitly in WorkspaceOverviewPage context)
    • reportID is undefined (no matching report found for non-existing room name)

    This causes isCurrentRoomMention to be true, which triggers the green highlight styling on line 62:

    StyleUtils.getMentionStyle(isCurrentRoomMention)

    The fix would need to check that both values are defined before comparing, or use a sentinel value instead of undefined for the context.

  6. MelvinBot commented on Mar 16, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When saving a workspace description that contains a non-existing room mention (e.g., #abc), the mention briefly shows a green highlight. Green highlight is reserved for the "currently opened room" mention, which is incorrect here — the user is on the workspace overview page, not in a room called #abc.

    What is the root cause of that problem?

    PR #55846 added room mention highlighting to workspace descriptions by wrapping the description in a MentionReportContext.Provider in WorkspaceOverviewPage.tsx. However, the context value is missing exactlyMatch: true:

    // WorkspaceOverviewPage.tsx:197
    {policyID: policy?.id, currentReportID: undefined}
    // Missing: exactlyMatch: true
    

    In MentionReportRenderer/index.tsx:61, the styling condition is:

    isGroupPolicyReport && (!exactlyMatch || navigationRoute)
    

    When exactlyMatch is falsy (not set), !exactlyMatch evaluates to true, short-circuiting the OR. The condition becomes just isGroupPolicyReport, which is always true when policyID is provided. This means every mention gets highlighted regardless of whether the room actually exists.

    For the green color specifically: isCurrentRoomMention is computed as reportID === currentReportIDValue. For a non-existing room, reportID is undefined (no match found). Since currentReportID is also undefined (WorkspaceOverviewPage explicitly passes undefined), undefined === undefined evaluates to true, triggering the green "our mention" style instead of blue.

    By contrast, PureReportActionItem and ReportDetailsPage both correctly set exactlyMatch: true in their context values, which prevents non-existing rooms from being highlighted.

    What changes do you think we should make in order to solve the problem?

    In src/pages/workspace/WorkspaceOverviewPage.tsx:197, add exactlyMatch: true to the mention context value:

    const mentionReportContextValue = {policyID: policy?.id, currentReportID: undefined, exactlyMatch: true};
    

    This makes the styling condition require a valid navigationRoute (which only exists when the room is found and has a real reportID), preventing non-existing rooms from being highlighted — matching the behavior of PureReportActionItem and ReportDetailsPage.

    What alternative solutions did you explore? (Optional)

    An alternative would be to add a guard in MentionReportRenderer to check if reportID is defined before applying any highlight styling. However, this would be a broader change affecting all consumers, whereas the missing exactlyMatch: true is the intended pattern already used by other providers and is a one-line fix scoped to the affected page.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. 6 remaining items

  8. izarutskaya commented on Mar 17, 2026

    @izarutskaya

    MacOS Monterey - Chrome
    Build 9.3.38-2
    Passed

    Screen.Recording.2026-03-17.at.10.41.46.mp4

    Windows/Chrome
    Build 9.3.38-2

    Recording.3673.mp4
  9. cristipaval commented on Mar 17, 2026

    @cristipaval
    Contributor

    Thanks! Closing it then

  10. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 18, 2026
  11. changed the title [-]Workspace - Non-existing room mention shows green highlight after saving description[/-] [+][Due for payment 2026-03-25] Workspace - Non-existing room mention shows green highlight after saving description[/+] on Mar 18, 2026
  12. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.39-3 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 2026-03-25. 🎊

  14. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    @madmax330 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]

  15. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions