-
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: Messages marked as read incorrectly for last chat #2553
Fix: Messages marked as read incorrectly for last chat #2553
Conversation
Ready for review. |
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 think this looks good, but I'll defer to @Julesssss for final review.
Merge conflicts just popped up |
@johnmlee101 Just resolved it. Thanks. |
@parasharrajat a final conflict to resolve |
…harrajat/unreadchat
5d619e3
to
388543d
Compare
@Julesssss Just cleared up the Conflicts. It seems there were some revert commits so I force pushed 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.
Verified again, LGTM
✋ 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 in version: 1.0.32-1🚀
|
@@ -125,6 +140,9 @@ class ReportActionsView extends React.Component { | |||
// The last sequenceNumber of the same report has changed. | |||
const previousLastSequenceNumber = lodashGet(lastItem(prevProps.reportActions), 'sequenceNumber'); | |||
const currentLastSequenceNumber = lodashGet(lastItem(this.props.reportActions), 'sequenceNumber'); | |||
const shouldRecordMaxAction = Visibility.isVisible() | |||
&& !(this.props.isDrawerOpen && this.props.isSmallScreenWidth); |
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.
This logic is a bit hard to follow... can we please get rid of the !(this && that)
logic so that this more accurately presents which scenarios we want to mark the report as read?
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 am not following your comment here. This check make sure that we don't mark the actions as read when drawer is open on small screens.
On the other hand, Drawer is always open on web so we want to let it read.
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.
Might be a personal preference, but it took me some time to parse
e.g. we were to explain this to someone we might say we want to mark as read in two situations
- The app is visible and we are not on a small screen
OR
- The app is visible, we are on a small screen, and the drawer is closed
Compare this to saying we want to mark as read when:
- The app is visible AND all other situations except when the drawer is open and the screen is small.
Maybe just me, but this is easier to understand if you see it like this...
// Always record on large screens. Only record on small screens when the sidebar is closed.
const shouldRecordMaxAction = Visibility.isVisible()
&& (!this.props.isSmallScreenWidth || !this.props.isDrawerOpen)
lmk if it looks the same to you 😂
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.
Yup. Will update.
🚀 Deployed to production in version: 1.0.39-5🚀
|
Please review @Julesssss
Details
Kindly, see the detailed proposal here #2539 (comment)
Fixed Issues
Fixes #2539Tests / QA Steps
Tested On
Screenshots
Web / Mobile Web / Desktop
video.mp4
iOS / Android
1619212041981.mp4