-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX 20759] Remove the *New* notifiers just as the deletion starts. #21557
[FIX 20759] Remove the *New* notifiers just as the deletion starts. #21557
Conversation
@@ -218,6 +219,15 @@ class ReportActionsView extends React.Component { | |||
}); | |||
} | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement @DanutGavrus 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a new condition in order to prevent unnecessary re-renders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well, but we still can improve the condition to prevent unnecessary re-render.
@@ -218,6 +219,15 @@ class ReportActionsView extends React.Component { | |||
}); | |||
} | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newMarkerReportActionID: newMarkerReportActionID, | |
newMarkerReportActionID, |
Fix the lint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tests well 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
✋ 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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