-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: suggestions causing excessive updates #45789
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: suggestions causing excessive updates #45789
Conversation
…/excesive-suggestion-updates-maimum-update-depth-exceeded
|
@hungvu193 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] |
|
With this change, when I texted Screen.Recording.2024-08-06.at.10.03.24.mov |
…gestion-updates-maimum-update-depth-exceeded
|
Can you reproduce this reliably? I can not reproduce that behaviour in any browser 🤔 Screen.Recording.2024-08-06.at.10.06.16.mov |
|
@hannojg I've just tested again, I can reproduce if StrictMode is enabled. Are you testing with StrictMode enabled? |
|
Hm weird, yeah strict mode is enabled for me |
|
If StrictMode is disabled, everything seems working fine. |
|
let me try with a clean 🤷 |
|
Here's the evidence Screen.Recording.2024-08-06.at.15.27.39.mov |
|
yeah, seems like you can reproduce it reliably |
|
hm, even after a fresh clone of the repo I can't reproduce that issue :/ |
|
Weird 😂 . Let me do a cleanup to see if I can reproduce it. |
|
Yeah, would appreciate if you could try - I just tested on a colleagues laptop and there its working as well (with strict mode enabled) |
|
Dang, it worked after I cleanup 😂 . Cool, I'll complete the checklist then |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeScreen.Recording.2024-08-06.at.17.41.19.moviOS: NativeScreen.Recording.2024-08-06.at.17.34.55.moviOS: mWeb SafariScreen.Recording.2024-08-06.at.16.55.35.movMacOS: Chrome / SafariChrome.movMacOS: DesktopDesktop.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #46810 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
neil-marcellini
left a comment
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, thanks
|
✋ 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/neil-marcellini in version: 9.0.18-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.18-10 🚀
|
Details
While working on this PR I noticed that there was an error about abbot excessive react updates.
This PR fixes this (Note: the stacktrace shown in the react logbox is actually incorrect):
Screen.Recording.2024-07-19.at.19.11.12.mov
The issue was in the suggestion components, that for every
value/selectionupdate of the composer were firingcalculate*Suggestionwhich was always updating the react statesuggestionswith a new object, even though there was no update compared to the previous state. The fix is to add an early return for this empty / initial states that are always the same.Fixed Issues
$ #46810
PROPOSAL:
Tests
@to mention someoneOffline tests
Name as tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-08-05.at.15.38.24.mov
Android: mWeb Chrome
android.mov
iOS: Native
Screen.Recording.2024-07-19.at.19.10.13.mov
iOS: mWeb Safari
Screen.Recording.2024-08-05.at.16.04.30.mov
MacOS: Chrome / Safari
Screen.Recording.2024-08-05.at.15.35.41.mov
MacOS: Desktop
Screen.Recording.2024-08-05.at.16.07.47.mov