Skip to content

[Due for payment 2026-05-22] [$250] Expense-Skeleton loading, then empty state is shown in Reports after creating expense via FAB #87032

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Sign in to ND app as a new account
  2. Create a workspace, open Workspaces tab
  3. Tap FAB "+" button - Create expense - Manual - enter an amount, merchant, and category
  4. Tap "Create expense" button
  5. 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")

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7120199_1775163133668.Empty_state.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022043746010452504334
  • Upwork Job ID: 2043746010452504334
  • Last Price Increase: 2026-04-27

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed on Apr 13, 2026
  2. MelvinBot commented on Apr 13, 2026

    @MelvinBot
    Contributor

    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 before handleNavigateAfterExpenseCreate() 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?

    1. 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.

    2. 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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 13, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 13, 2026
  5. melvin-bot commented on Apr 13, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

  6. 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
  7. melvin-bot commented on Apr 13, 2026

    @melvin-bot
  8. 63 remaining items

  9. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 20, 2026
  10. melvin-bot commented on May 21, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on May 22, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @eh2077 owed $250 via NewDot
    • ROLE: @emkhalid paid $(AMOUNT) via Upwork (LINK)

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2043746010452504334/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. mallenexpensify commented on May 23, 2026

    @mallenexpensify
    Contributor

    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

  13. laurenreidexpensify commented on May 23, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @eh2077

  14. emkhalid commented on May 23, 2026

    @emkhalid
    Contributor

    @mallenexpensify I Accepted the job, thanks

  15. mallenexpensify commented on May 25, 2026

    @mallenexpensify
    Contributor

    @emkhalid paid, summary updated above. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions