perf: recompute derived value on display name changes#70087
Conversation
…ibutes-on-displayname-change
|
@brunovjk can you please review this with priority? |
| ONYXKEYS.COLLECTION.REPORT_METADATA, | ||
| ], | ||
| compute: ([reports, preferredLocale, transactionViolations, reportActions, reportNameValuePairs, transactions], {currentValue, sourceValues, areAllConnectionsSet}) => { | ||
| compute: ([reports, preferredLocale, transactionViolations, reportActions, reportNameValuePairs, transactions, personalDetails], {currentValue, sourceValues, areAllConnectionsSet}) => { |
There was a problem hiding this comment.
Could you add unit tests to test if the derived values are recomputed with the personal details change or not?
This comment was marked as outdated.
This comment was marked as outdated.
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp70087_android_native.movAndroid: mWeb Chrome70087_android_web.moviOS: HybridApp70087_ios_web.moviOS: mWeb Safari70087_ios_web.movMacOS: Chrome / Safari70087_web_chrome.movMacOS: Desktop70087_web_desktop.mov |
|
Caught up on the issue and related discussions. The code changes align with the slack conversation. I’ve only tested a few scenarios so far; everything looks good. I’ll continue testing other potentially affected areas and all platforms first thing tomorrow. |
…ibutes-on-displayname-change
|
Added tests and recordings for the PR ✅ |
|
@brunovjk thanks for testing! |
brunovjk
left a comment
There was a problem hiding this comment.
Tested this PR and didn’t notice any difference in user-facing behavior compared to production. Based on the logs and performance tracking, the optimizations are working—report attributes now only update when the displayName actually changes, not for unrelated updates.
A couple of existing bugs that exist both in this PR when in staging:
- On native Android, the LHN doesn’t update with the new name until the affected chat is opened:
Android: HybridApp
bug_main_android.mov
- On web (Chrome, mWeb iOS/Android), when user B changes their name, user A’s view updates everywhere except the expense preview title in an unfocused window. The title only update when the window regains focus:
MacOS: Chrome
bug_main_chrome.mov
These issues are not introduced or fixed by this PR, so I don’t think they block merging, but please let me know if anyone feels otherwise.
|
@brunovjk can you please report those in slack for Qa to create issue? great job testing! |
mountiny
left a comment
There was a problem hiding this comment.
Thanks for adding the automated test, if you think of other ways to cover this method in automated tests, please add them given how crucial this is
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Sure :D |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.9-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.2.11-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.2.12-4 🚀
|
| if (Object.keys(previousDisplayNames).length === 0) { | ||
| previousDisplayNames = currentDisplayNames; | ||
| previousPersonalDetails = personalDetails; | ||
| return false; |
There was a problem hiding this comment.
returning false here doesn't recompute report attributes when personalDetails is set first time.
So it caused #76563
Explanation of Change
Currently, every change to personal details causes full recomputation of report attributes derived value (~800ms). This PR aims to recompute it only when there is any update to
displayNameof any user.Onyx.merge("personalDetailsList", {"19568722": {"login": "loginf@netcgtf.com"}})Onyx.merge("personalDetailsList", {"19568722": {"phoneNumber": "112445"}})Onyx.merge("personalDetailsList", {"19568722": {"displayName": "Tomasz Misiukiewicz"}})Fixed Issues
$ #68865
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
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
android.mov
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov