Repository navigation
Show a thread as unread in the LHN when you mark your own message as unread - #104289
Conversation
…age as unread Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
🤖 Web test steps verification results: The PR's Tests section is still a TODO, so I used the repro steps from the linked issue. Creating a 1:1 chat passed, and so did the regression check (your own sent message does not bold the row). I could not verify the thread and "Mark as unread" steps (2–5). The web test harness can't hover, right-click, or long-press, so it couldn't open the message context menu. Those steps are unverified, not failures of the fix.
|
|
🤖 Android test steps verification results: ✅ pass On standalone Android NewDot, marking your own message as unread (in a thread or a 1:1 chat) now bolds that LHN row, and reading it again removes the bold. Sending your own message without marking it unread leaves the row non-bold, and no JS errors or crash screens appeared. The PR's Tests section is still a TODO, so these steps come from the linked issue's repro steps.
|
|
@MelvinBot Please merge with the latest main |
…nreadInLHN Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
|
I merged the latest I couldn't run the unit tests locally, so CI will check them. |
|
@MelvinBot Tidy the tests/QA sections with the following test steps. Steps:
|
|
I updated the Tests and QA Steps sections with your six steps and removed the TODO placeholders. Both sections still include the JS console check. I didn't change the Offline tests section. It's still empty. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp104289-android-hybrid-001.mp4Android: mWeb Chrome104289-mweb-chrome-001.mp4iOS: HybridApp104289-ios-hybrid-001.mp4iOS: mWeb Safari104289-mweb-safari-001.mp4MacOS: Chrome / Safari104289-web-chrome-001.mp4 |
|
@MelvinBot Please tick the boxes in the PR Author Checklist section as I have already verified these in PR Reviewer Checklist as a co-author |
|
I ticked all 36 boxes in the PR Author Checklist, based on your Reviewer Checklist. I didn't change anything else in the PR description. Two of the ticked items point to sections that are still empty:
The four accessibility items and the High Traffic account item have no matching line in the reviewer checklist. Uncheck any that don't apply. |
|
@MelvinBot Please mark the PR as ready for review. |
|
I marked this PR as ready for review. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 658633792e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (isUnreadFromTimestamp && drivingActorAccountID === deprecatedCurrentUserAccountID && !(lastReadTime < lastMentionedTime)) { | ||
| // A manual mark-as-unread wins over the "last actor is me" rule, so a report where only the current user has written | ||
| // (e.g. a new thread) still shows as unread. Reading the report moves lastReadTime forward, so this can't stick. | ||
| if (isUnreadFromTimestamp && drivingActorAccountID === deprecatedCurrentUserAccountID && !(lastReadTime < lastMentionedTime) && !report.manuallyMarkedUnreadReportActionID) { |
There was a problem hiding this comment.
Expire the manual override after its anchor is read
When readNewestAction() advances lastReadTime, it deliberately leaves manuallyMarkedUnreadReportActionID set until a return trip or refresh. While that stale marker remains, any later self-authored action whose lastVisibleActionCreated arrives after lastReadTime—for example, through a delayed server update or another device—now bypasses the last-actor guard and makes the LHN row unread again. The marker only proves that an action was marked previously, not that the current timestamp gap belongs to that action; expire the override after its anchor is read or verify that the unread gap still corresponds to the marked action.
Useful? React with 👍 / 👎.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.31-0 🚀
|
|
No help site update needed. This bug fix makes marking your own message as unread display the expected bold chat row; it adds no workflow and makes no existing article incorrect. |
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀
Bundle Size Analysis (Sentry): |









Explanation of Change
When you mark your own message as unread in a report where nobody else has written (for example, a new thread), the LHN row doesn't turn bold.
markCommentAsUnreadrollslastReadTimeback correctly, but it can only pick another person aslastActorAccountIDif someone else wrote in the report. Otherwise the current user stays the last actor, andisUnreadreturnsfalsebecause of its "last actor is me" rule.This PR makes
isUnreadskip that rule whenreport.manuallyMarkedUnreadReportActionIDis set.markCommentAsUnreadalready sets that field optimistically. The rule still applies in every other case, so your own sent messages still don't make a report unread.The change can't leave a report stuck as unread:
readNewestAction) and sending a message both movelastReadTimeforward, soisUnreadFromTimestampgoes back tofalseeven while the marker is still set.openReportclears the marker when you return to the report or refresh.Tests:
isUnread: own message without the marker (read), own message with the marker (unread), marker set after the report was read again (read), and another user's message with the marker (unread, unchanged).isUnreadcompares the last actor with the session account.findLastAccessedReportneeds the session account to be a participant of its fake reports.Limitation: this fixes the device where you mark the message. Other devices get
lastActorAccountIDfrom the server'sMarkAsUnreadresponse, so they may still show the row as read.AI tests run locally:
npm test -- tests/unit/ReportUtilsTest.ts: passed, 1488/1488. The new "own message with the marker" test fails without the source change.npm testonSidebarUtilsTest,SidebarTest,SidebarOrderTest,UnreadIndicatorsTest, andactions/ReportTest: passed.npm run typecheck,npm run lint-changed,npm run spell-changed: passed.oxfmtformat check in this environment. The changed lines are within the 190-character print width.Fixed Issues
$ #103759
PROPOSAL: #103759 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari