-
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: new messages don't get shown as unread #23683
Fix: new messages don't get shown as unread #23683
Conversation
@arosiclair Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
Coming from https://expensify.slack.com/archives/C01GTK53T8Q/p1690395933930439?thread_ts=1690394092.631009&cid=C01GTK53T8Q, I'll be reviewing this
@situchan could you review this please. desk.mp4 |
@rayane-djouah This needs to be |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-07-27.at.3.43.52.AM.movScreen.Recording.2023-07-27.at.3.47.58.AM.movMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
On Screen.Recording.2023-07-27.at.4.06.00.AM.movAlso notice that the green dot does not appear in the LHN for new messages. |
Similar results on mweb Android. The message is getting un-bolded automatically after ~1-2s in the LHN. Auto scrolling seems broken as well. Screen.Recording.2023-07-27.at.4.13.16.AM.mov |
yes, edited. |
Auto scrolling was working fine before, I don't know where is the problem with it |
@rayane-djouah Can you reproduce the behaviour I mentioned though? @situchan Can you please confirm this as well? |
@allroundexperts the behaviour you mentioned is also occuring on main so it's not introduced by this PR Video for reproduction on main: Nouvelle.video.mp4 |
@rayane-djouah What about android web? There is no |
I also retested the sollution on Desktop but it's not working there. |
I already did and uploaded the video in the checklist above. |
I can't find it in the checklist |
Might have missed the upload. Checking again and uploading now. Meanwhile, can you check android web? |
@allroundexperts it works fine for me on android web 2023-07-27.01-16-48.mp4 |
I don't think the fix is going in right direction. Screen.Recording.2023-07-27.at.6.17.25.AM.movAnd on desktop, it marked as unread and then immediately marked as read. And it's not consistent. Sometimes works, sometimes not work. Screen.Recording.2023-07-27.at.6.18.52.AM.mov |
Agreed. Something seems off here. |
const scrollToBottom = useCallback(() => { | ||
reportScrollManager.scrollToBottom(); | ||
}, [reportScrollManager]); | ||
|
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 isn't doing anything. This scrollToBottom function will be recreated on each re-render of the component.
Why? Because reportScrollManager
isn't stable. It will be a new object on every re-render.
Thus the useCallback
has to be applied inside the reportScrollManager
module!
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 do think that this might cause some of the issues we are seeing at the minute
This PR is superseded by this PR: |
Thanks for the effort everyone, Hanno has been able to follow up with a fix #23729 but there is still issue with mobile so we can look into that next |
Details
Fixed Issues
$ https://expensify.slack.com/archives/C01GTK53T8Q/p1690394092631009
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests above.
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
2023-07-26.22-19-56.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
video.mp4
Android