Skip to content

[Due for payment 2025-03-17] [$250] Web - LHN - Mark as unread a message after deleting self mention displays green dot in LHN #57205

Closed

Description

@lanitochka17

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.1.2-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Open self DM report
  3. Mention self and send it
  4. Send another message
  5. Delete the previous DM message
  6. Navigate to LHN
  7. Right click on the report in LHN and select mark as unread

Expected Result:

Mark as unread a message after deleting self mention must not display green dot in LHN

Actual Result:

Mark as unread a message after deleting self mention displays green dot in LHN

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6735287_1738858158724.Recording_24.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021894240180371891525
  • Upwork Job ID: 1894240180371891525
  • Last Price Increase: 2025-02-25
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 20, 2025
  2. melvin-bot commented on Feb 20, 2025

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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.

  3. bernhardoj commented on Feb 21, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Marking report as unread after deleting a mention still shows a green dot. This issue can only happen if we perform the step at least twice.

    What is the root cause of that problem?

    The green dot will show if the report is unread while there is a mention to the current user.

    return !!('isUnreadWithMention' in reportOrOption && reportOrOption.isUnreadWithMention) || lastReadTime < lastMentionedTime;

    When we delete the mention, the lastMentionedTime is supposed to be empty.

    App/src/libs/actions/Report.ts

    Lines 1631 to 1638 in 14c5b21

    const didCommentMentionCurrentUser = ReportActionsUtils.didMessageMentionCurrentUser(reportAction);
    if (didCommentMentionCurrentUser && reportAction.created === report?.lastMentionedTime) {
    const reportActionsForReport = allReportActions?.[reportID];
    const latestMentioneReportAction = Object.values(reportActionsForReport ?? {}).find(
    (action) => action.reportActionID !== reportAction.reportActionID && ReportActionsUtils.didMessageMentionCurrentUser(action),
    );
    optimisticReport.lastMentionedTime = latestMentioneReportAction?.created ?? null;
    }

    However, if we perform the step twice, the lastMentionedTime isn't empty. That's because, we only exclude the mention action that we delete, but not the mention action that is already deleted before.

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

    We need to check for whether the action is already deleted or not too.

    && ReportActionsUtils.shouldReportActionBeVisible(action, action.reportActionID)
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We can test adding 2 mention, deleting both of them, and assert that lastMentionedTime is empty.

  4. melvin-bot commented on Feb 24, 2025

    @melvin-bot

    @kadiealexander Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 25, 2025
  6. melvin-bot commented on Feb 25, 2025

    @melvin-bot
  7. changed the title [-]Web - LHN - Mark as unread a message after deleting self mention displays green dot in LHN[/-] [+][$250] Web - LHN - Mark as unread a message after deleting self mention displays green dot in LHN[/+] on Feb 25, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 25, 2025
  9. melvin-bot commented on Feb 25, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

  10. 13 remaining items

  11. changed the title [-][$250] Web - LHN - Mark as unread a message after deleting self mention displays green dot in LHN[/-] [+][Due for payment 2025-03-17] [$250] Web - LHN - Mark as unread a message after deleting self mention displays green dot in LHN[/+] on Mar 10, 2025
  12. melvin-bot commented on Mar 10, 2025

    @melvin-bot

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

  13. melvin-bot commented on Mar 10, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.10-6 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-03-17. 🎊

    For reference, here are some details about the assignees on this issue:

    • @bernhardoj requires payment through NewDot Manual Requests
    • @eh2077 requires payment through NewDot Manual Requests
  14. melvin-bot commented on Mar 10, 2025

    @melvin-bot

    @eh2077 @kadiealexander @eh2077 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. eh2077 commented on Mar 16, 2025

    @eh2077
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: https://github.com/Expensify/App/pull/41888/files#r1997627995

    • [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: NA

    • [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: https://github.com/Expensify/Expensify/issues/481877

    Regression Test Proposal

    Precondition:

    NA

    Test:

    1. Open any chat without GBR
    2. Send 2 mentions to self
    3. Delete both mentions
    4. Mark the report as unread from LHN
    5. Verify there is no GBR

    Do we agree 👍 or 👎

  16. melvin-bot commented on Mar 17, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@kadiealexander)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1894240180371891525/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  17. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Mar 18, 2025
  18. bernhardoj commented on Mar 18, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  19. JmillsExpensify commented on Mar 19, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  20. JmillsExpensify commented on Apr 9, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @eh2077

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions