Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53a95d037f
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const lastReadTime = report.lastReadTime ?? ''; | ||
| const reportLastReadTime = report.lastReadTime ?? ''; | ||
| const threadLastReadTime = oneTransactionThreadReport?.lastReadTime ?? ''; | ||
| const lastReadTime = reportLastReadTime > threadLastReadTime ? reportLastReadTime : threadLastReadTime; |
There was a problem hiding this comment.
Compare parent and thread read state independently
Using max(report.lastReadTime, thread.lastReadTime) can hide unread updates in the parent report because read times are tracked per report, not globally. readNewestAction() only updates the currently opened report’s lastReadTime (see src/libs/actions/Report/index.ts), so if the thread is read later than the parent, this line can make isUnread() return false even when report.lastVisibleActionCreated > report.lastReadTime. In LHN paths that call isUnread(report, oneTransactionThreadReport, ...), this can suppress bold/unread for real unread parent activity.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@marufsharifi What do you think of the review comment here?
There was a problem hiding this comment.
@rojiphil Yes, this regression is valid, and I missed it earlier.
I’ve updated the approach now. Instead of merging parent/thread lastReadTime, the fix checks whether the newest visible action for the one-transaction row was authored by the current user. If yes, we do not mark the row unread/bold; otherwise, unread logic stays the same.
What do you think about this updated approach?
There was a problem hiding this comment.
Yes, this regression is valid, and I missed it earlier.
@marufsharifi Before we consider the updated approach, I am curious to know the test steps that would fail our earlier approach. Theoretically, the concern seems valid but I am not sure of a reproducible case of failure. I may be missing something but can you share a use case causing regression please?
There was a problem hiding this comment.
@rojiphil
The regression case for the earlier max(report.lastReadTime, thread.lastReadTime) approach is when the parent report still has unread activity, but the transaction thread was read later.
Example:
- Parent report has an unread message from another user.
- Thread has no unread activity.
- User opens only the thread, so only
thread.lastReadTimeis updated. - LHN unread is computed for the parent row.
In that state, report.lastVisibleActionCreated > report.lastReadTime, but the newer thread.lastReadTime gets picked by max(...), which can suppress unread for the parent row.
I couldn’t reproduce this reliably with normal UI flow either, but I was able to reproduce it by forcing the Onyx values into that state.
There was a problem hiding this comment.
@marufsharifi Dug in a little deeper on the review comment by Codex. Looks like the concern is only theoretical and I think we can ignore it. Our case deals specifically for a one transaction thread report. In this case, the parent IOU/Expense report represents the only transaction, and a real, unread parent IOU/Expense report activity is not possible.
I think, if we cannot reproduce the problem without manual Onyx updates, we can revert back to the 53a95d0 commit. What do you think?
There was a problem hiding this comment.
@rojiphil That makes sense. Since the issue isn’t reproducible in practice and only exists as a theoretical concern, I’m good with reverting to the previous commit. Thanks!
trjExpensify
left a comment
There was a problem hiding this comment.
Commented on the parent issue, let's discuss there #76677 (comment)
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@rojiphil, gentle bump. thanks. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp88251-android-hybrid-001.mp4Android: mWeb Chrome88251-mweb-chrome-001.mp4iOS: HybridApp88251-ios-hybrid-001.mp4iOS: mWeb Safari88251-mweb-safari-001.mp4MacOS: Chrome / Safari88251-web-chrome-001.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
@marufsharifi Thanks for the changes.
@dangrous @trjExpensify LGTM and works well too.
All yours now. Thanks.
dangrous
left a comment
There was a problem hiding this comment.
Is it possible to add a test for this? Code seems good otherwise!
@dangrous sure. added the test. could take another look when you have a moment? thanks |
dangrous
left a comment
There was a problem hiding this comment.
LGTM! @trjExpensify are you all set with this direction? I know we were still discussing a bit on the issue.
|
Not really, but we can continue discussing on the issue. |
|
Cool, we'll hold until we're resolved there, then |
|
@dangrous main is merged now - thanks |
Discussed on the issue, we'll move forward here and open a separate issue shortly.
|
🚧 @dangrous 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.3.80-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required. This PR is a bug fix to internal logic in No user-facing features, settings, terminology, or workflows were added or changed — so no updates to |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.81-2 🚀
|
Explanation of Change
This change makes the Left Hand Navigation unread state more accurate for one-transaction expense threads.
Before, the app only looked at the parent expense report’s read time when deciding whether to show the thread in bold. That caused two confusing cases: the person who edited an expense could still see their own thread as unread, and the other participant might not see the thread bolded even though there was clearly new activity inside it. With this update, we use the most recent read time from either the parent report or the linked transaction thread, so the bold state better matches what the user has actually seen.
Fixed Issues
$ #76677
PROPOSAL: #76677 (comment)
Tests
Preconditions: User A and User B have a chat
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
REC-2026041851536.PM.mp4
Android: mWeb Chrome
REC-2026041852237.PM.mp4
iOS: Native
REC-2026041843846.PM.mp4
iOS: mWeb Safari
REC-2026041844639.PM.mp4
MacOS: Chrome / Safari
REC-2026041843352.PM.mp4