Fix optimistic message created while offline is marked as unread#56628
Conversation
| !wasActionTakenByCurrentUser(message) && wasActionCreatedWhileOffline(message, isOffline, lastOfflineAt.current, lastOnlineAt.current, preferredLocale), | ||
| !wasActionTakenByCurrentUser(message) && | ||
| wasActionCreatedWhileOffline(message, isOffline, lastOfflineAt.current, lastOnlineAt.current, preferredLocale) && | ||
| !(message.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD || message.isOptimisticAction), |
There was a problem hiding this comment.
I proceed with a different approach because I feel like having the isOffline condition in wasActionCreatedWhileOffline makes sense with the function name. So, I updated wasMessageReceivedWhileOffline instead because if it's an optimistic action, then it's a message that we send, not receive.
|
nevermind, it was indeed flaky. |
|
Fixed |
|
A test still fails, but it's unrelated and a known flaky test. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-02-23.at.4.05.06.PM.movAndroid: mWeb ChromeScreen.Recording.2025-02-23.at.4.02.28.PM.moviOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2025-02-23.at.16.01.14.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2025-02-23.at.16.03.38.mp4MacOS: Chrome / SafariScreen.Recording.2025-02-23.at.3.57.57.PM.movMacOS: DesktopScreen.Recording.2025-02-23.at.3.58.24.PM.mov |
The test is now fixed in #56057 |
|
✋ 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/lakchote in version: 9.1.5-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.5-5 🚀
|
| expect(unreadIndicator).toHaveLength(0); | ||
| }); | ||
|
|
||
| it('Do not display the new line indicator when tracking an expense on self DM while offline', async () => { |
There was a problem hiding this comment.
Hi there! coming from #66037 (comment). This was an asynchronous test, and a promise should have been returned for Onyx.clear as per https://github.com/Expensify/App/blob/main/tests/README.md#asynchronous-testing
Explanation of Change
Fixed Issues
$ #55560
PROPOSAL: #55560 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
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))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.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4