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-05-22] [$250] Expense-Skeleton loading, then empty state is shown in Reports after creating expense via FAB #87032
Version Number: 9.3.52-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176675/test-cases/41237189 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone 15 iOS 26.3.1 App Component: Money Requests
Action Performed:
Sign in to ND app as a new account
Create a workspace, open Workspaces tab
Tap FAB "+" button - Create expense - Manual - enter an amount, merchant, and category
Tap "Create expense" button
When navigated to the Reports tab, observe the page
Expected Result:
Created expense appears in the Reports/ Expenses
Actual Result:
Skeleton loading is show in the expense place , then empty state screen appears ("You haven't created any expenses yet")
Race condition between optimistic search snapshot generation and navigation to the Search/Reports tab.
When "Create expense" is tapped, getMoneyRequestInformation() computes optimistic Onyx data beforehandleNavigateAfterExpenseCreate() adds the Search route to the navigation stack. Inside that computation, getSearchOnyxUpdate() (src/libs/actions/IOU/index.ts:6441) calls getCurrentSearchQueryJSON() which reads the current navigation state for a Search route. Since navigation hasn't happened yet, it returns undefined and no optimistic snapshot data is generated.
Then when the Search page mounts, useSearchPageSetup (src/hooks/useSearchPageSetup.ts:47-56) fires search() with skipWaitForWrites=true, which reaches the server before the deferred REQUEST_MONEY write is processed — returning empty results for a new account. No mechanism re-triggers the search after the expense is actually created, so the user sees skeleton → empty state.
Why wide layout (macOS Chrome) is particularly affected: The Search route pre-insertion at IOURequestStepConfirmation.tsx:396 only fires on narrow layout (getIsNarrowLayout()), so on wide layout there is never a Search route when the optimistic data is computed.
Why iOS is affected: On narrow layout the pre-insert fires after a 300ms delay (PRE_INSERT_FULLSCREEN_DELAY). If the user taps "Create expense" before the timer fires or the timer is delayed during animations, the same race occurs.
What changes do you think we should make in order to solve the problem?
Make getSearchOnyxUpdate not depend on current navigation state. Instead of calling getCurrentSearchQueryJSON() to find a Search route, compute the target snapshot hash deterministically from the expense type (the navigation target is always type:expense or type:invoice — this is known at creation time). This ensures optimistic snapshot data is always generated regardless of navigation timing.
Include search metadata in the optimistic snapshot merge at IOU/index.ts:6494-6502. Currently only data is merged into the snapshot — the search object (with type, status, etc.) is missing, so isSearchDataLoaded returns false even when optimistic data exists. Adding the metadata ensures the list renders optimistically.
What alternative solutions did you explore? (Optional)
Moving the navigation call before the optimistic data computation — rejected because navigation is intentionally deferred to avoid blocking the JS thread during the transition.
Adding a re-fetch after the deferred write flushes — this would work but adds unnecessary network latency when optimistic data should suffice.
Possibly related issue:#85698 ("Infinite loading on Reports>Expenses pg when creating expense from home QAB/FAB for first time") — same symptom and likely same root cause.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Expense-Skeleton loading, then empty state is shown in Reports after creating expense via FAB[/-][+][$250] Expense-Skeleton loading, then empty state is shown in Reports after creating expense via FAB[/+]on Apr 13, 2026
Contributor: @emkhalid paid $250 via Upwork
Contributor+: @eh2077 due $250 via NewDot
@emkhalid can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022043746010452504334
Activity
MelvinBot commentedon Apr 13, 2026
Proposal
What is the root cause of that problem?
Race condition between optimistic search snapshot generation and navigation to the Search/Reports tab.
When "Create expense" is tapped,
getMoneyRequestInformation()computes optimistic Onyx data beforehandleNavigateAfterExpenseCreate()adds the Search route to the navigation stack. Inside that computation,getSearchOnyxUpdate()(src/libs/actions/IOU/index.ts:6441) callsgetCurrentSearchQueryJSON()which reads the current navigation state for a Search route. Since navigation hasn't happened yet, it returnsundefinedand no optimistic snapshot data is generated.Then when the Search page mounts,
useSearchPageSetup(src/hooks/useSearchPageSetup.ts:47-56) firessearch()withskipWaitForWrites=true, which reaches the server before the deferredREQUEST_MONEYwrite is processed — returning empty results for a new account. No mechanism re-triggers the search after the expense is actually created, so the user sees skeleton → empty state.Why wide layout (macOS Chrome) is particularly affected: The Search route pre-insertion at
IOURequestStepConfirmation.tsx:396only fires on narrow layout (getIsNarrowLayout()), so on wide layout there is never a Search route when the optimistic data is computed.Why iOS is affected: On narrow layout the pre-insert fires after a 300ms delay (
PRE_INSERT_FULLSCREEN_DELAY). If the user taps "Create expense" before the timer fires or the timer is delayed during animations, the same race occurs.What changes do you think we should make in order to solve the problem?
Make
getSearchOnyxUpdatenot depend on current navigation state. Instead of callinggetCurrentSearchQueryJSON()to find a Search route, compute the target snapshot hash deterministically from the expense type (the navigation target is alwaystype:expenseortype:invoice— this is known at creation time). This ensures optimistic snapshot data is always generated regardless of navigation timing.Include
searchmetadata in the optimistic snapshot merge atIOU/index.ts:6494-6502. Currently onlydatais merged into the snapshot — thesearchobject (withtype,status, etc.) is missing, soisSearchDataLoadedreturns false even when optimistic data exists. Adding the metadata ensures the list renders optimistically.What alternative solutions did you explore? (Optional)
Possibly related issue: #85698 ("Infinite loading on Reports>Expenses pg when creating expense from home QAB/FAB for first time") — same symptom and likely same root cause.
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Apr 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (
External)[-]Expense-Skeleton loading, then empty state is shown in Reports after creating expense via FAB[/-][+][$250] Expense-Skeleton loading, then empty state is shown in Reports after creating expense via FAB[/+]melvin-bot commentedon Apr 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022043746010452504334
63 remaining items
melvin-bot commentedon May 21, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 22, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 23, 2026
Payment Summary
Contributor: @emkhalid paid $250 via Upwork
Contributor+: @eh2077 due $250 via NewDot
@emkhalid can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022043746010452504334
^ Test case created. Thx
laurenreidexpensify commentedon May 23, 2026
$250 approved for @eh2077
emkhalid commentedon May 23, 2026
@mallenexpensify I Accepted the job, thanks
mallenexpensify commentedon May 25, 2026
@emkhalid paid, summary updated above. Thx.