-
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 web maintainVisibleContentPosition with strict mode enabled #45313
Fix web maintainVisibleContentPosition with strict mode enabled #45313
Conversation
@techievivek 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] |
Reviewer Checklist
Screenshots/VideosAndroid: NativeRecord_2024-07-12-22-32-54.mp4Android: mWeb ChromeRecord_2024-07-12-22-39-37.mp4iOS: NativeScreen.Recording.2024-07-12.at.9.23.24.PM.moviOS: mWeb SafariScreen.Recording.2024-07-12.at.9.04.07.PM.movMacOS: Chrome / SafariScreen.Recording.2024-07-12.at.8.56.50.PM-1.movMacOS: DesktopScreen.Recording.2024-07-12.at.10.42.23.PM.mov |
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 PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@roryabraham can we please create a issue to handle payment for this PR review, Thanks! |
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.0.7-3 🚀
|
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 9.0.7-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.8-6 🚀
|
Details
Reported initially here
Strict mode causes effects to run twice which affects our maintainVisibleContentPosition implementation. Basically what ends up happening is that the mutation observer is setup, but then disconnected when the effect that is supposed to remove it on unmount is ran initially (since effects are ran twice). Then when we try to connect it again, it is prevented by
isListRenderedRef
.To fix it we can run the setup code in
onLayout
after settingisListRenderedRef
to true, so we don't rely on other code paths to callsetupMutationObserver
again.Before:
Screen.Recording.2024-07-11.at.14.37.05.mov
After:
Screen.Recording.2024-07-11.at.14.34.46.mov
Fixed Issues
$ #44625
PROPOSAL:
Tests
Offline tests
QA Steps
Verify that no errors appear in the JS console
Verify that the correct message is linked to using the following instructions
Create a chat between Account A and Account B.
Send 200 messages from Account A to Account B.
Copy the link to the 70th message and send it to Account B (first link).
Copy the link to the 150th message and send it to Account B (second link).
From Account A, click on the first link. Verify redirection to the exact message.
From Account A, click on the second link. Verify redirection to the exact message.
From Account B, click on the first link. Verify redirection to the exact message.
From Account B, click on the second link. Verify redirection to the exact message.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-07-11.at.14.34.46.mov
MacOS: Desktop
Screen.Recording.2024-07-11.at.14.56.47.mov