-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[CP Staging] fix: frequent component re-mount #45335
Conversation
@srikarparsi 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] |
The RCA seems solid and accurate to me @kirillzyusko , Dope work !! |
I have started to build iOS locally |
This comment has been minimized.
This comment has been minimized.
I guess i found one bug from the PR, I will post it once i confirm that it doesn't happen on the staging app, ~10 minutes |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
BugNot able to post a message after i visit a report transaction on iOS Native: Reproduction Steps:
Screen.Recording.2024-07-12.at.7.23.26.PM.mov |
@kirillzyusko can you test on your side and confirm if this is reproducible ? the flickering issue doesn't happen anymore confirmed 👍 |
Note I am able to post again if i reopen the chat from LHN |
Yes, it's reproducible on my end
Because |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Smart !! 👀 |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
seems to be fixed now @kirillzyusko 😌 Screen.Recording.2024-07-12.at.10.52.15.PM.movCan you try fix lint (Maybe put a exception there? idk if there is any such exception for Prettier diff) |
wait no!! the |
Note that i can still send when i press enter button on keyboard so the button is disabled somehow: Screen.Recording.2024-07-12.at.11.04.25.PM.mov |
@allgandalf oh no! Will check web and CI tomorrow! |
Damn, sorry to see it did not work fully yet. Great job so far. It feels like it might be better to try to investigate the rootcause or bisect where this happened first cause revert might be safer than some more complex not fully tested fix |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@kirillzyusko , can you quickly move the |
No, I think I will do that in this PR 👀 |
cool, but lets wait for the perf tests to pass now :))) |
@kirillzyusko did you test the latest changes on web? I am still able to reproduce the bug on web: Screen.Recording.2024-07-15.at.2.28.13.PM.mov |
@allgandalf yeah, I tested this, but it worked on my end. Let me reset cache and try again! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-07-15.at.4.05.42.PM.movAndroid: mWeb ChromeScreen.Recording.2024-07-15.at.4.08.25.PM.moviOS: NativeScreen.Recording.2024-07-15.at.4.00.45.PM.moviOS: mWeb SafariScreen.Recording.2024-07-15.at.4.03.32.PM.movMacOS: Chrome / SafariScreen.Recording.2024-07-15.at.3.36.04.PM.movMacOS: DesktopScreen.Recording.2024-07-15.at.3.41.17.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.
I approve this change, the deploy blocker is solved by these changes, TESTS WELL ON ALL PLATFORMS!
thanks @kirillzyusko for the PR, this really pushed us to far, thanks for the back and forth too, had fun unblocking this, all yours @srikarparsi @mountiny 🙇
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
(cherry picked from commit 8198564)
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.6-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.6-6 🚀
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.0.6-8 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.0.6-8 🚀
@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.6-8 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
Details
The problem happens when re-render happens (shown keyboard can be one of the trigger, since we store that data in the context).
When re-render from
App.tsx
level comes, then:() => {
fromfreezeScreenWithLazyLoading
Since this function handles screen-level entities -> we'll re-mount entire screen. keyboard appear -> we re-mount screen -> we destroy
composer
-> we loose focus -> keyboard hides. When screen is mounted -> we retrieve input focus and we get infinite loop 🤯To fix this I decided to memoize the output of
freezeScreenWithLazyLoading
. I think that how it was designed to work, i. e. cache once and then return cached instance of the component.Fixed Issues
https://expensify.slack.com/archives/C01GTK53T8Q/p1720776606394749
$ #45152
PROPOSAL: N/A
Tests
On Android
Offline tests
N/A
QA Steps
On Android
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
telegram-cloud-document-2-5226817861695065883.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop