Repository navigation
Conversation
| // Not a room or PolicyExpenseChat, generate title from participants | ||
| const participantAccountIDs = report?.participantAccountIDs ?? []; | ||
| // Not a room or PolicyExpenseChat, generate title from first 5 other participants | ||
| const participantAccountIDs = report?.participantAccountIDs?.slice(0, 6) ?? []; |
There was a problem hiding this comment.
Are we sure the current user is going to be returned in the first six results?
There was a problem hiding this comment.
I have the same thoughts, but looking and the next line, we filter out the current user accountID and pop the rest if it's still six accountIDs.
There was a problem hiding this comment.
Fair point. I was only looking at the changed code. Still wouldn't it be cleaner/easier if we took a slice of paricipantsWithoutCurrentUser to make this?
There was a problem hiding this comment.
Sorry guys for this delay, just to clarify: this PR was only intended to improve the performance - on big accounts the .filter() loop simply took ages and looping through all these items is redundant from the product perspective (please see the pinned proposal and investigation). Hope this helps :)
Reviewer Checklist
Screenshots/VideosAndroid: Native37907.Android.mp4Android: mWeb Chrome37907.mWeb-Chrome.mp4iOS: Native37907.iOS.moviOS: mWeb Safari37907.mWeb-Safari.movMacOS: Chrome / Safari37907.mWeb-Chrome.mp4MacOS: Desktop37907.Desktop.mp4 |
mollfpr
left a comment
There was a problem hiding this comment.
LGTM 👍
For the test steps and QA steps, I have suggestion to get easier notice the changes this PR made. Instead of verifying the list in LHN, we can verify it in the display name in the search list or in the report detail page.
|
Regression here #38052 |
|
@deetergp The problem is that 1- here App/src/pages/home/HeaderView.tsx Line 89 in da76977 When we ask for the 2- Even if we fix the issue mentioned on (1), on a group of chat with 8 participants, the component We are getting the list to be displayed from here: App/src/pages/home/HeaderView.tsx Line 81 in da76977 and this will be a prop for the Back to the issue of this PR:
As I understand, we are fixing Note: After this quick analysis, I can said that we are limiting the call to Issue not fixed and persist somewhere else:As I mentioned above, we are fixing App/src/pages/home/HeaderView.tsx Line 79 in da76977 For that, solving this issue and enhancing performance, I am suggesting limiting the number of App/src/pages/home/HeaderView.tsx Line 78 in da76977 in my proposal This way, we limit the display to just 5 participants and we call the function getPersonalDetailsForAccountID just 5 times. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.50-5 🚀
|
|
I'm confused here @mollfpr @jbroma. This PR's description says:
Yet as it turns out, that is not what is happening. Despite these changes, we are still seeing more than five names in the report title. Am I missing something here? I think we need to treat this as a regression and fix it. |
|
this PR was limited to just fixing performance aspect of the fallback name used as last resort, by the looks of it we might apply the same logic in |
|
@jbroma @mollfpr @deetergp To confirm, the ellipsis tooltip also shows max 5 names and seems the user can't see all names in tooltip. Is that fine? Screen.Recording.2024-03-15.at.15.24.38.mov
But we show in the tooltip earlier which might be useful for the users. |
Details
PR is a part of Callstack performance audit of the app
In this PR, the number of participants used to determine the Report name via
getReportNameis limited to first 5 participants other than current user. This change allows to cap the performance impact ofgetReportName.In some cases, when the number of participants is big, we were needlessly calculating
getDisplayNameForParticipantwhere in the end, we wouldn't be able to display it since the output is trimmed afterwards anyways.$ #37925
PROPOSAL: #34494
Tests
Offline tests
QA Steps
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 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop