Repository navigation
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot review |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ReviewThe fix looks correct. I found no blocking issues. The ref stops the Suggestions (non-blocking):
What I checked
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebcfe6ea32
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (isLoadingUnreportedTransactions) { | ||
| return; | ||
| } | ||
| isFetchingMoreUnreportedTransactionsRef.current = false; |
There was a problem hiding this comment.
Re-trigger pagination after clearing the in-flight ref
When a search still leaves the list shorter than the viewport after a page succeeds and hasMoreUnreportedTransactionsResults remains true, the descendant FlashList runs onEndReached during that response commit before this parent passive effect; the ref is therefore still true, so the callback returns. Clearing only the ref here schedules no new commit, leaving pagination stalled until an unrelated render or scroll occurs, so matching expenses on page 3 or later may never appear.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
FlashList calls onEndReached after its own follow-up render, not in the same render that delivers the page response. React runs this page's effects first, so the ref is already reset by the time the next onEndReached call happens.
I tested it with a search that leaves only a couple of rows and didn't scroll or click anything. After
each response, the next page was requested on its own, one request at a time, and the offset kept going up
|
@getusha kind bump for review here |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-11-02.at.11.57.57.movAndroid: mWeb ChromeScreen.Recording.2026-11-02.at.11.49.44.moviOS: HybridAppScreen.Recording.2026-11-02.at.11.56.10.moviOS: mWeb SafariScreen.Recording.2026-11-02.at.11.53.17.movMacOS: Chrome / SafariScreen.Recording.2026-11-02.at.11.48.38.mov |
|
@VickyStash In |
|
@truph01 Done, please take a look |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.31-0 🚀
|
|
No help site update needed — this PR fixes a crash when searching existing expenses, restoring expected behavior without changing the workflow or making existing guidance incorrect. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Typing in on the
Add existing expensepage could crash the app withMaximum update depth exceeded(Sentry APP-DQ2).When the search leaves only a few rows, the list is always at its end, so
onEndReachedfires on every render. Each call fetched the next page and updatedoffset, which re-rendered the page and triggeredonEndReachedagain. The existingisLoadingUnreportedTransactionscheck was meant to prevent this.fetchUnreportedExpensessets that flag totruethrough the request's optimistic data, but Onyx applies optimistic data asynchronously, while this loop runs synchronously inside one chain of React commits. The page kept requestingOpenUnreportedExpensesPageuntil React hit its update limit.The fix sets a ref when a page is requested and clears it when
isLoadingUnreportedTransactionsgoes back tofalse. While the ref is set,fetchMoreUnreportedTransactionsreturns early, so only one request is in flight at a time.Fixed Issues
$ #104501
PROPOSAL: N/A
Tests
Precondition: an account with more than 50 unreported expenses, so the list has more than one page.
In computer settings, set the scrollbar to be always visible. The bug could be reproduced without it too, but just simpler this way.
Offline tests
Same, as in Tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same, as in Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
after.mp4