-
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
Fixed LHN Ordering #35907
Fixed LHN Ordering #35907
Conversation
We may need to create a perf test to know the actual performance hit. |
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.
@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 :
|
personalDetails, | ||
preferredLocale: preferredLocale ?? CONST.LOCALES.DEFAULT, | ||
policy, | ||
parentReportAction, | ||
reportErrors, |
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 is not added to the dependencies of useMemo
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should re-render as transactionViolations changes, which is a dependency of memo.
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.
But it is not a dependency of reportIDsWithErrors
here, which means we won't re-run getAllReportErrors
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubham1206agra bump, can we pass the transactions to getAllReportErrors
?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubham1206agra @fedirjh what's the latest here?
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.
We are awaiting @shubham1206agra to implement the changes.
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.
@fedirjh Can you retest this now?
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.
Let's add violations transactions to getAllReportErrors
as param and memoize them.
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] |
): string[] { | ||
const isInGSDMode = priorityMode === CONST.PRIORITY_MODE.GSD; | ||
const isInDefaultMode = !isInGSDMode; | ||
const allReportsDictValues = Object.values(allReports); | ||
|
||
const reportIDsWithViolations = new Set<string>(); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. It didn't give any.
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 to me.
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. |
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.
Looking good. Just this open request from @youssef-lr
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.
LGTM!
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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
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