[FIX 20759] Remove the *New* notifiers just as the deletion starts.#21557
[FIX 20759] Remove the *New* notifiers just as the deletion starts.#21557techievivek merged 10 commits into
Conversation
| } | ||
|
|
||
| // If the last unread message was deleted, remove the *New* green marker and the *New Messages* notification at scroll just as the deletion starts. | ||
| if (this.props.reportActions.length > 0 && this.props.reportActions[0].pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !this.props.network.isOffline) { |
There was a problem hiding this comment.
I've added !this.props.network.isOffline in order to have a consistent behavior while offline. In current staging, while offline, the New markers do not disappear. In this PR, without this check, while offline, the New markers would disappear only for the last message. See this video:
offline_consistency.mp4
There was a problem hiding this comment.
Screen.Recording.2023-06-28.at.01.09.36.mov
I think the condition can be improved. Right now, it's called twice.
There was a problem hiding this comment.
I've added a new condition in order to prevent unnecessary re-renders.
There was a problem hiding this comment.
I've also added now ReportUtils.isUnread(this.props.report) inside the condition, such that is does not return true anymore when deleting the last message if it(or any other one) was NOT marked as unread.
Reviewer Checklist
Screenshots/VideosWeb21557.Web.movMobile Web - Chrome21557.mWeb.Chrome.webmMobile Web - Safari21557.mWeb.Safari.mp4Desktop21557.Desktop.moviOS21557.iOS.mp4Android21557.Android.webm |
|
@DanutGavrus The marker is immediately removed for the last new message, but it's still delayed for the oldest last message. Screen.Recording.2023-06-27.at.23.10.41.mov |
I can not reproduce. Is it still happening to you? If so, are you able to always reproduce it? reproduce.mp4 |
|
The chat I opened is messed up. The delay is gone after I re-sign into the account and open the same chat. Thanks @DanutGavrus for confirming it! |
mollfpr
left a comment
There was a problem hiding this comment.
Tests well, but we still can improve the condition to prevent unnecessary re-render.
| } | ||
|
|
||
| // If the last unread message was deleted, remove the *New* green marker and the *New Messages* notification at scroll just as the deletion starts. | ||
| if (this.props.reportActions.length > 0 && this.props.reportActions[0].pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !this.props.network.isOffline) { |
There was a problem hiding this comment.
Screen.Recording.2023-06-28.at.01.09.36.mov
I think the condition can be improved. Right now, it's called twice.
…s no unread ones.
|
@mollfpr I've run |
| const newMarkerReportActionID = ReportUtils.getNewMarkerReportActionID(this.props.report, reportActionsWithoutPendingOne); | ||
| if (newMarkerReportActionID !== this.state.newMarkerReportActionID) { | ||
| this.setState({ | ||
| newMarkerReportActionID: newMarkerReportActionID, |
There was a problem hiding this comment.
| newMarkerReportActionID: newMarkerReportActionID, | |
| newMarkerReportActionID, |
Fix the lint.
There was a problem hiding this comment.
@mollfpr Thanks! Fixed lint issue & merged main again.
|
@DanutGavrus There's still a delay after going to the last message using the new message button at the top. Screen.Recording.2023-06-29.at.17.46.07.movStep:
|
|
@DanutGavrus I mean, there's a delay on the new marker removed from the page. |
@mollfpr Investigating now. Sorry for the confusion, I deleted my last comment as I've re-read your Steps. |
I've reported a similar bug on Slack here and that fix will also fix your finding from the root cause. Would you suggest to implement that in this PR too? |
|
Clicking the New Message** floating button should remove the marker. In that case, the issue I mentioned earlier here will not exist. @DanutGavrus The bug you reported might be related to the above issue, so I am continuing the PR test. |
|
✋ 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/techievivek in version: 1.3.36-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.36-5 🚀
|
Details
When deleting the last unread message, the New marker briefly appears for a second before disappearing & New Messages notification persists after message is deleted.
Fixed Issues
$ #20759
PROPOSAL: #20759 (comment)
Tests
Same as QA Steps.
Offline tests
No offline tests.
QA Steps
I. New marker delay at hiding:
II. New Messages infinite notification:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
web.mp4
Mobile Web - Chrome
android_web.mp4
Mobile Web - Safari
ios_safari.mp4
Desktop
desktop.mp4
iOS
ios_native.mp4
Android
android_native.mp4