Skip to content

Expense - Infinite loading after adding an expense to report #87209

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.53-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #86636
Email or phone of affected tester (no customers): jsdjosidjiojisojio3@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an empty report.
  4. Open the report.
  5. Click + > Create expense > Manual.
  6. Create a manual expense.

Expected Result:

Expense report will show the expense details after creating the expense.

Actual Result:

Expense report loads infinitely after creating the expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7123275_1775528740240.12.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Apr 7, 2026
  2. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #86636

  3. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 7, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. MelvinBot commented on Apr 7, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: reportTransactionsAndViolations.ts:32 mutates currentValue in-place instead of creating a new object reference. Onyx 3.0.58's reference-stable removeNestedNullValues (introduced in PR #86636) now returns the same reference when no nulls are found, so Onyx's keyChanged() sees lastConnectionCallbackData === value → skips subscriber notifications → useOnyx never re-renders → infinite loading.

    Recommended Fix: Change line 32 of src/libs/actions/OnyxDerived/configs/reportTransactionsAndViolations.ts from:

    const reportTransactionsAndViolations = currentValue ?? {};

    to:

    const reportTransactionsAndViolations = currentValue ? {...currentValue} : {};

    This ensures the derived value compute function always returns a new top-level reference when data changes, so Onyx detects the update and notifies subscribers.

    Likely duplicate of: #87179 ("Report Preview Not Updating After Adding Expense Until Manual Refresh") — the consolidated deploy blocker covering 4 other issues (#87197, #87199, #87200, #87201) all traced to the same root cause.

    Investigation details

    Data flow leading to the bug:

    1. User creates expense → Onyx updates COLLECTION.TRANSACTION with optimistic data
    2. reportTransactionsAndViolations derived value compute runs, reuses currentValue reference, mutates it in-place
    3. setDerivedValue calls Onyx.set(key, value)
    4. removeNestedNullValues(value) returns the same reference (no nulls to strip — new behavior in Onyx 3.0.58)
    5. keyChanged() checks lastConnectionCallbackData === value → true → subscriber callback skipped
    6. useOnyx hook never fires onStoreChange → React never re-renders → skeleton/loading persists

    Why this worked before Onyx 3.0.58:
    Before the structural sharing optimization, removeNestedNullValues always created a fresh object copy, which meant even mutated-in-place values got a new reference, masking the latent mutation bug.

    Contributing factor: shouldWaitForTransactions in MoneyRequestReportUtils.ts:132-146 checks pendingFields?.createReport but optimistic data sets pendingFields.createChat, so the bypass for optimistic reports doesn't trigger. When transactions.length === 0 and report.total !== 0, the skeleton is shown.


    Next Steps: This appears to be a duplicate of #87179. Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  6. pecanoro commented on Apr 7, 2026

    @pecanoro
    Contributor

    I read Melvin's explanation and it seems to be a front-end related bug so removing the web deploy blocker label

  7. removed
    DeployBlockerIndicates it should block deploying the API
    on Apr 7, 2026
  8. 8 remaining items

  9. m-natarajan commented on Apr 7, 2026

    @m-natarajan

    Not Repro, Windows 10 / Chrome, Honor x6b /Android 14, v9.3.53-7

    SVID_20260407_160855_1.mp4
    bandicam.2026-04-07.16-01-03-616.mp4
  10. Julesssss commented on Apr 7, 2026

    @Julesssss
    Contributor

    Thank you! Checking off

  11. melvin-bot commented on Apr 8, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  12. added
    ReviewingHas a PR in review
    and removed
    ReviewingHas a PR in review
    on Apr 9, 2026
  13. changed the title [-]Expense - Infinite loading after adding an expense to report[/-] [+][Due for payment 2026-04-23] Expense - Infinite loading after adding an expense to report[/+] on Apr 16, 2026
  14. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-04-23. 🎊

  16. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    @Julesssss The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  17. changed the title [-][Due for payment 2026-04-23] Expense - Infinite loading after adding an expense to report[/-] [+]Expense - Infinite loading after adding an expense to report[/+] on Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions