You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-11-25] fix: Search page re-fires a first page that is already refetching #106777
When the user opens an expense from Spend, or edits it in the RHP, the app sends two Search requests for the same query. A refetch from useSearchAutoRefetch, refreshSearchAfterReportAction or the totals retry marks the snapshot pending, and that reopens the guard in useSearchPageSetup, so the page fires its own request with shouldSaveRecentSearch: true. search() sees that only the new request has the save flag, so it re-sends the whole query after the first one finishes. On large accounts each response blocks the JS thread for seconds, so every edit freezes the app twice.
Solution
useSearchPageSetup now skips its request when the snapshot is loaded, the page already showed this query since the user last came to Search, and a first-page request for the same query is already running. A new isFirstPageSearchInFlight helper in Search.ts checks the totals, footer breakdown and trip-rooms conditions that search() uses to decide on a re-fire, and leaves out the save-flag check that caused the duplicate. When a user arrives on a query that another caller is refreshing, the page still sends the flagged request, so the query still goes into recent searches.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
changed the title [-]fix: Search page re-fires a first page that is already refetching[/-][+][Due for payment 2026-11-25] fix: Search page re-fires a first page that is already refetching[/+]on Nov 21, 2026
Activity
melvin-bot commentedon Nov 18, 2026
@mountiny @TMisiukiewicz
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
[-]fix: Search page re-fires a first page that is already refetching[/-][+][Due for payment 2026-11-25] fix: Search page re-fires a first page that is already refetching[/+]