-
Notifications
You must be signed in to change notification settings - Fork 3.5k
perf: Improve performance of selecting participants #70860
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
perf: Improve performance of selecting participants #70860
Conversation
| /> | ||
| )} | ||
| <MoneyRequestParticipantsSelector | ||
| participants={isSplitRequest ? participants : []} |
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 default to a stable reference empty array instead
| onFinish={goToNextStep} | ||
| iouType={iouType} | ||
| action={action} | ||
| isPerDiemRequest={isPerDiemRequest(initialTransaction)} |
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 can be stabilized as well
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-06.at.15.20.35.movAndroid: mWeb ChromeScreen.Recording.2025-10-01.at.23.09.07.moviOS: HybridAppScreen.Recording.2025-10-01.at.23.06.02.moviOS: mWeb SafariScreen.Recording.2025-10-01.at.23.07.31.movMacOS: Chrome / SafariScreen.Recording.2025-10-01.at.22.34.11.movMacOS: DesktopScreen.Recording.2025-10-01.at.23.04.55.mov |
|
I noticed that we introduced conditional rendering here:
via this commit, to address the issue: "can't create expense on native platform". RCA of the issue: "Can't create expense on native platform"
Problem with the current code change in this PR
My suggested solution to address both "Can't create expense on native platform." issue and "Remove conditional rendering of MoneyRequestParticipantsSelector" issues
|
|
@truph01 I tried to check if this change could cause the regression you mentioned, but I couldn’t reproduce the exact steps based on the issue description — I don’t see “Share with my accountant” after creating an expense:
Do you know if there’s another flow I should follow to check this potential issue? |
|
@OlimpiaZurek You should early return in our |
25764c5 to
3e4193a
Compare
|
Thanks @truph01 |
@OlimpiaZurek I think we can remove all the changes we made in IOURequestStepParticipants.tsx, except the removal:
|
|
@truph01 Let me check the measurements and performance impact again, since improving that was the initial goal of this PR. I’ll do some profiling to see the results and confirm whether the fallback changes are still needed here. |
|
Measured results:
Given these results, the fallback provides extra performance benefits, so it makes sense to keep it. |
|
Thanks @OlimpiaZurek! Could you address the:
and
Meanwhile, I'll complete the checklist |
|
@OlimpiaZurek Also, could you help merge main here? |
|
@truph01 I’ve fixed all React Compiler errors. Regarding the PR author checklist, I see that all checkboxes are marked, and I’m not able to edit the PR description since I’m not the author of this PR . |
| const [textInputAutoFocus, setTextInputAutoFocus] = useState<boolean>(!isNative); | ||
| const selectionListRef = useRef<SelectionListHandle | null>(null); | ||
| const cleanSearchTerm = useMemo(() => debouncedSearchTerm.trim().toLowerCase(), [debouncedSearchTerm]); | ||
| const cleanSearchTerm = debouncedSearchTerm.trim().toLowerCase(); |
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.
@OlimpiaZurek Why do we need to remove useMemo here? Doesn't using useMemo help us avoid recalculating on every re-render?
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.
Same question regarding the other useMemo removal—doesn't it help prevent unnecessary recalculations on each re-render?
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.
@truph01 I removed the useMemocalls because React Compiler was failing with: “React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved.” I wasn’t fully convinced we needed to remove all of them , but I did it to get the compiler workflow to pass.
Since that workflow is currently disabled due to instability, I’ve reverted those removals for now.
This reverts commit f4b1fd4.
mountiny
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.
I will move this ahead, the checklist would be filled fully when updated
|
✋ 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/mountiny in version: 9.2.27-0 🚀
|
|
Hi @TMisiukiewicz @mountiny . Which account should we use that does not have activePolicyID? |
|
@IuliiaHerets I think it would need to be user without any group policy no? I think it is safe to check this one off from the checklist as normal regression testing should catch any issues |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.2.27-6 🚀
|

Explanation of Change
Fixed Issues
$ #71324
PROPOSAL:
Tests
activePolicyIDset as default policyOffline tests
n/a
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.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov