Conversation
|
We may need to create a perf test to know the actual performance hit. |
luacmartins
left a comment
There was a problem hiding this comment.
@shubham1206agra it seems like we're not sorting the reports here and also not taking into account the performance suggestions we raised during discussion. Are you still working on this POC?
|
@luacmartins We are sorting the reports already. I need to write a test here to measure performance. I will write the suggestion in a commit later. |
|
@fedirjh were you able to take a look at this PR? |
|
@shubham1206agra It seems that this PR is still in progress? Could you please include the performance improvements discussed in the linked issue? Specifically this one #33029 (comment) |
Yes but not alphanumerically, channels room names can include
Let's also include this optimisation in |
|
@fedirjh Can you test this PR on HT account and see if anything is out of order? |
This reverts commit 6b19fd2.
|
@fedirjh I think we are checking error on too many reports. Let me redo this in another way, and see if there are still performance regressions. |
What do you mean ?
@shubham1206agra Do we have any performance regression? |
|
|
@shubham1206agra Could you please also update the test ? I don't think we are getting the correct results for this test :
|
| preferredLocale: preferredLocale ?? CONST.LOCALES.DEFAULT, | ||
| policy, | ||
| parentReportAction, | ||
| reportErrors, |
There was a problem hiding this comment.
This is not added to the dependencies of useMemo
There was a problem hiding this comment.
reportErrors seems to be an object, if we add it as dependency we should memoize it also on the parent component
parent:
const reportErrors = useMemo(() => reportIDsWithErrors[reportID] ?? {}, [reportID]);
and not sure about reportIDsWithErrors
cc: @youssef-lr
| (errorsMap, reportKey) => { | ||
| const report = chatReports[reportKey]; | ||
| const allReportsActions = allReportActions[reportKey.replace(ONYXKEYS.COLLECTION.REPORT, ONYXKEYS.COLLECTION.REPORT_ACTIONS)]; | ||
| const errors = OptionsListUtils.getAllReportErrors(report, allReportsActions) || {}; |
There was a problem hiding this comment.
I think we should pass the violations to getAllReportErrors and add them to the dependencies of the memo. If we don't, this function will not be re-triggered if a violation changes in Onyx.
There was a problem hiding this comment.
It should re-render as transactionViolations changes, which is a dependency of memo.
There was a problem hiding this comment.
But it is not a dependency of reportIDsWithErrors here, which means we won't re-run getAllReportErrors
There was a problem hiding this comment.
@youssef-lr I think this is not needed. We are already subscribing to the violation collection, and it should re-render whenever any of the violations are updated.
There was a problem hiding this comment.
While yes the page will re-render, the reportIDsWithErrors will remain unchanged, as it only listens to changes in report actions and chat reports.
There was a problem hiding this comment.
@shubham1206agra bump, can we pass the transactions to getAllReportErrors?
There was a problem hiding this comment.
Apologies for the confusion, @fedirjh I disagree. Prior to the PR we weren’t pinning RBR reports, now that we’re memoized them, they are not subscribing to changes in the transaction.
There was a problem hiding this comment.
@shubham1206agra @fedirjh what's the latest here?
There was a problem hiding this comment.
We are awaiting @shubham1206agra to implement the changes.
Screen.Recording.2024-02-28.at.11.13.31.AM.mov@youssef-lr Please check this video. |
|
@danieldoglas 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] |
| const isInDefaultMode = !isInGSDMode; | ||
| const allReportsDictValues = Object.values(allReports); | ||
|
|
||
| const reportIDsWithViolations = new Set<string>(); |
There was a problem hiding this comment.
Couldn't this be moved to SidebarLinksData.js similar to reportIDsWithErrors ? I think this will give some perf boost?
There was a problem hiding this comment.
Nope. It didn't give any.
|
Removing myself since I'm not part of the original issue. Not sure why pullerbear added me. |
It seems like it always add an extra reviewer once PR is no longer a draft. |
luacmartins
left a comment
There was a problem hiding this comment.
Looking good. Just this open request from @youssef-lr
Changes requested have been applied and Carlos already approved.
|
✋ 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/youssef-lr in version: 1.4.47-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.4.47-10 🚀
|
Details
Fixed Issues
$ #33029
PROPOSAL: #33029 (comment)
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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 so 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-02-28.at.1.52.56.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-02-28.at.12.24.46.PM.mov
iOS: Native
Screen.Recording.2024-02-28.at.1.37.35.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-02-28.at.12.09.16.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-28.at.11.38.22.AM.mp4
MacOS: Desktop
Screen.Recording.2024-02-28.at.12.49.06.PM.mov