Fix: New message marker is not displayed on the first message in expense report#65918
Fix: New message marker is not displayed on the first message in expense report#65918youssef-lr merged 5 commits intoExpensify:mainfrom
Conversation
|
@c3024 Regarding the regression, here's the RCA and the solution implemented in this PR RCAWhen checking for unread actions to determine whether to call App/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx Lines 290 to 292 in 15e4323 And since system-generated messages (like CSV export, approval, etc.) are created with the current user as the actor, this condition excludes them from being considered as "unread actions". As a result, SolutionWe should update the |
|
The same logic is used in For example,
But, this does not happen for |
|
After looking into the issue, I found that the problem actually comes from this condition RCA
App/src/libs/ReportActionsUtils.ts Lines 1884 to 1893 in 15e4323 The function returns true only when an action is unread AND either it's the first action OR the previous action is already read.
When In contrast, the
BUT we could get the same issue on
Here is how to reproduce it:
New-Expensify.mp4SolutionWe should update the condition in const hasAnyUnreadActions = reportActions.some(action => isReportActionUnread(action, report?.lastReadTime ?? ''));
if (isUnread(report, transactionThreadReport) || (lastAction && isCurrentActionUnread(report, lastAction)) || hasAnyUnreadActions) {
...
} |
|
Thanks for the digging. Even when there are four unread actions the unread marker shows up only on the exported report action because the other actions are excluded from the visible actions here. App/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx Lines 169 to 179 in dfa504a So, would it be better to match this unread logic with the unread marker logic with passing the if (isUnread(report, transactionThreadReport) || (lastAction && isCurrentActionUnread(report, lastAction, visibleReportActions)))here and use it first before finding the function isCurrentActionUnread(report: OnyxEntry<Report>, reportAction: ReportAction, visibleReportActions?: ReportAction[]): boolean {
const lastReadTime = report?.lastReadTime ?? '';
const sortedReportActions = visibleReportActions ?? getSortedReportActions(Object.values(getAllReportActions(report?.reportID)));
/* remaining code */
} |
|
Yeah, I think your approach is better than broadly checking for any unread actions. Thanks for the suggestion! I'll update the PR accordingly |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppunreadAndroid.movAndroid: mWeb ChromeunreadAndroidmWeb.moviOS: HybridAppunreadiOS.moviOS: mWeb SafariunreadiOSmWeb.movMacOS: Chrome / SafariunreadChrome1.movMacOS: DesktopunreadDesktop.mov |
|
✋ 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/youssef-lr in version: 9.1.88-0 🚀
|
|
Seems like when we do this steps:
The This behavior does not occur if:
Scenario 1 (Fail): MacOS-Chrome.mp4Scenario 2 (Success): MacOS-Chrome-2.mp4Scenario 3 (Success): MacOS-Chrome-3.mp4We can fix this by adding early check here to ensures that the report is only marked as read when the user is actually viewing it cc @c3024 |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.88-3 🚀
|



Explanation of Change
Fixed Issues
$ #63427
PROPOSAL: #63427 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.Chrome.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.Safari.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4
MacOS: Desktop
MacOS-Desktop.mp4