Repository navigation
Stop requiring lastActorAccountID to show a chat as unread - #102653
Conversation
|
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
A chat whose only visible action is a report preview arrives with an empty lastActorAccountID, because the actor sits on the IOU report the preview points at. isUnread() returns true for it, but getOptionData, getIsUnreadReportForInboxTab and the option list's isOptionUnread each ANDed that with lastActorAccountID and turned it back to false. So a conversation the user had never opened rendered read in the LHN, the Unread tab reported nothing to read, and search autocomplete showed it in regular weight. That guard was a proxy for "the only message was deleted", which isUnread now covers itself: it gates on isEmptyReport, and generateIsEmptyReport resolves the last visible message through getLastVisibleAction, so a chat whose only message was deleted still comes back empty and not bold.
|
@ZhenjaHorbach this is ready |
|
Will check the PR today or tomorrow morning! |
|
@ZhenjaHorbach kindly bump |
|
Sorry |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-10-16.at.12.47.25.movAndroid: mWeb ChromeScreen.Recording.2026-10-16.at.12.47.25.moviOS: HybridAppScreen.Recording.2026-10-16.at.12.42.32.moviOS: mWeb SafariScreen.Recording.2026-10-16.at.12.37.49.movMacOS: Chrome / SafariScreen.Recording.2026-10-16.at.12.26.57.mov |
|
@codex |
|
@MelvinBot |
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. |
Code reviewThe fix is sound for the reported bug. The removed 1. New expense/IOU reports now show as unread to their creator (side effect)
2. The deleted-message test passes on The fixture in SidebarUtilsTest.ts:1591-1592 sets
Supporting details
|
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
The existing deleted-message cases both set a real lastActorAccountID, which is the shape where the removed guard was a no-op anyway. That isolates the empty-report check inside isUnread, but it leaves untested the shape the server actually writes on delete, where lastActorAccountID is zeroed and the chat was never read. Add that case for getOptionData and for the Unread tab path. The tab test also asserts the report is present in the set, because isUnreadReport reads falsy for a report that was never displayed and would pass without it.
fixed 1, 2 seems not valid |
Yeah |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 lakchote 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/lakchote in version: 9.5.14-0 🚀
|
|
No help site update needed. This bug fix makes a chat you haven't opened show as unread (bold in the Inbox and listed in the Unread tab), which is what users already expect, so no existing article becomes incorrect. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.14-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
A chat whose only visible message is a report preview arrives with an empty
lastActorAccountID, and the LHN, the Unread tab and the search list all required that field before treating a report as unread, so a conversation the user had never opened showed as read. This removes the requirement from all three checks and relies on the empty-report check already inisUnread, which covers the case the requirement was added for.Fixed Issues
$ #102117
PROPOSAL: #102117 (comment)
Tests
Two accounts are needed: account A with an existing Expensify account, and account B whose email has never been used.
Offline tests
Unread state is read from data already in Onyx and this change adds no request, so the flow behaves the same offline.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
androis.app.mp4
Android: mWeb Chrome
android.web.mp4
iOS: Native
ios.app.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mp4