fix: crash when searching results on participants step#90918
Conversation
Prevent increasing maxResults to load more search results when there are no more results to fetch.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@QichenZhu 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-05-20.at.5.33.08.PM.movAndroid: mWeb ChromeScreen.Recording.2026-05-19.at.7.46.56.PM.moviOS: HybridAppSimulator.Screen.Recording.-.iPhone.17.-.2026-05-19.at.19.31.13.moviOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.17.-.2026-05-19.at.19.34.02.movMacOS: Chrome / SafariScreen.Recording.2026-05-20.at.5.31.49.PM.mov |
|
@rohit9625 could you address the merge conflict while @QichenZhu is reviewing+testing. Thanks! |
Sure, I'm resolving the conflicts now :) |
|
Hi @MariaHCD, can we merge this now? |
|
Reviewing 👀 |
|
@MariaHCD looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @MariaHCD has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/MariaHCD in version: 9.3.79-1 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a technical bug fix in |
|
Deploy Blocker ##91366 was identified to be related to this PR. |
|
I prepared a revert that fixes the blocker linked above, though since this PR initially fixed a crash, I'm not sure reverting is the best option. The blocker isn't so bad in comparison. |
|
@francoisl the crash only happens under certain conditions, so the blocker seems more impactful. |
Revert #90918 "fix: crash when searching results on participants step"
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.79-4 🚀
|
|
🚀 Deployed to staging by https://github.com/MariaHCD in version: 9.3.80-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a code-level bug fix that adds a guard to prevent |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.81-2 🚀
|
Explanation of Change
Whenever searching for participants by email at the Participants Step, the
maxResultswere being increased irrespective of the search results viaonEndReached->onListEndReachedfunction. Hence, thedatapassed to theFlashListbeing updated and it results in re-rendering the list items. However, when there less results in the list, theFlashListkeep executing it'sonEndReachedfunction and updating themaxResultseverytime. This results, in an infinite loop and causing the crash due to repeated calls ofsetStatefunction.So, I added a gaurd to prevent increasing
maxResultsto load more search results when there are no more results to fetch.Fixed Issues
$ #90533
PROPOSAL: $ #90533 (comment)
Tests
Offline tests
Note: For reliable reproduction of the crash, please refer to my proposal before testing this PR.
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Screen.Recording.2026-05-17.at.8.18.13.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-05-17.at.8.25.36.PM.mov
iOS: Native
Screen.Recording.2026-05-18.at.2.16.00.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-05-17.at.8.59.53.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-17.at.8.07.24.PM.mov