Skip to content

[Due for payment 2026-07-21] LHN - Marking an unread message as unread does not mark the conversation as unread #95103

Closed

Description

@applause-bot

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.4.26-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: https://test-management.browserstack.com/projects/2219752/test-runs/62923718/folder/13176910/41237480/1534027983?sort=%2Bidentifier
Email or phone of affected tester (no customers): n/n
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Mac 15.4.1 Safari
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Go to https://staging.new.expensify.com
  2. Navigate to a unread conversation with some history
  3. Mark a new message as unread
  4. Navigate away from the conversation

Expected Result:

The conversation is marked as unread
When navigating back to the conversation, the new message marker is still displayed on top of the message

Actual Result:

Marking an unread message as unread does not mark the conversation as unread, the new message marker is not displayed on top of the message

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7196919_1782938354688.Recording__2483.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7196919

Issue OwnerCurrent Issue Owner: @VickyStash

Activity

  1. applause-bot commented on Jul 1, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/296d56b2dd68bc99ba5cb911039c102f5f7f619530cf043575a91519fee93b54

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 1, 2026
  3. melvin-bot commented on Jul 1, 2026

    @melvin-bot

    Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Jul 1, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 1, 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.
  6. MelvinBot commented on Jul 2, 2026

    @MelvinBot
    Contributor

    Proposal

    🤖 Automated deploy-blocker analysis — confidence: High (root cause verified by diffing the production branch against staging).

    TL;DR: This is a regression introduced by #94817 (Decompose ReportActionsList: 11, merged 2026-06-30). It removed the block in useUnreadMarker that re-seeds the unread-marker cutoff when the hook instance is reused for a different report. Recommended fix: revert #94817.

    What is the root cause of that problem?

    useUnreadMarker keeps the marker cutoff in local state unreadMarkerTime, seeded from the report's lastReadTime. Because the report view / hook instance is reused across report switches, there was a block that re-seeded unreadMarkerTime from the current report's lastReadTime whenever reportID changed:

    const [trackedReportID, setTrackedReportID] = useState(reportID);
    if (trackedReportID !== reportID) {
        setTrackedReportID(reportID);
        setUnreadMarkerTime(reportLastReadTime); // re-seed on report switch
    }

    #94817 deleted this block (its only functional change; the author's new test assumes "one mount per report", which is not true when the instance is reused). After deletion, on navigating away and back:

    1. Marking a message unread lowers lastReadTime in Onyx and emits unreadAction_…; the listener updates the marker on the currently mounted report, so it briefly shows. ✅
    2. Navigating away reuses the same hook instance with a new reportID, but unreadMarkerTime is no longer re-seeded — it keeps the old value, and the "push down to newest" branch (useUnreadMarker.ts:139) advances it to the most recent action.
    3. On returning, the cutoff is stale/too-new, so getUnreadMarkerReportAction finds nothing before it → the "New" divider is gone and the conversation no longer reads as unread. ❌
    Why this PR (and why it's staging-only) — verification

    Key refs (SHA e3b4f3c): markCommentAsUnread (writes lastReadTime correctly — not the culprit), useUnreadMarker.

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

    Revert #94817 — it is a self-contained decompose/refactor and reverting cleanly restores the per-report re-seed.

    If a roll-forward is preferred over a revert, re-add the trackedReportID guard so unreadMarkerTime is re-seeded from the current report's lastReadTime whenever reportID changes.

    What alternative solutions did you explore? (Optional)

    Considered the self-authored isUnread suppression (#91940) as the cause but ruled it out — it is already in production.

    Related issues


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/pull/94817) to create a draft PR (revert).
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. rlinoz commented on Jul 2, 2026

    @rlinoz
    Contributor

    Hey @VickyStash would be able to take a quick look at this one?

  8. VickyStash commented on Jul 2, 2026

    @VickyStash
    Contributor

    Reverting of #94817 doesn't fix the issue for me.
    Going to try to check #94149

  9. VickyStash commented on Jul 2, 2026

    @VickyStash
    Contributor

    Reverting of #94149 fixes the issue

  10. VickyStash commented on Jul 2, 2026

    @VickyStash
    Contributor

    @rlinoz Instead of reverting the whole #94149 updates, we can just revert the useMarkAsRead updates, wdyt?

  11. 8 remaining items

  12. rlinoz commented on Jul 2, 2026

    @rlinoz
    Contributor
  13. m-natarajan commented on Jul 2, 2026

    @m-natarajan

    This issue is not repro on Windows 10/Chrome Build v9.4.26-4

    Recording.996.mp4
  14. removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jul 2, 2026
  15. added and removed
    ReviewingHas a PR in review
    on Jul 6, 2026
  16. changed the title [-]LHN - Marking an unread message as unread does not mark the conversation as unread[/-] [+][Due for payment 2026-07-13] LHN - Marking an unread message as unread does not mark the conversation as unread[/+] on Jul 6, 2026
  17. melvin-bot commented on Jul 6, 2026

    @melvin-bot

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

  18. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.27-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 2026-07-13. 🎊

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

  19. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    @rlinoz @VickyStash 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  20. changed the title [-][Due for payment 2026-07-13] LHN - Marking an unread message as unread does not mark the conversation as unread[/-] [+][Due for payment 2026-07-21] LHN - Marking an unread message as unread does not mark the conversation as unread[/+] on Jul 14, 2026
  21. melvin-bot commented on Jul 14, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.33-8 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-07-21. 🎊

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

  22. melvin-bot commented on Jul 14, 2026

    @melvin-bot

    @rlinoz @VickyStash 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]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions