Skip to content

[Due for payment 2026-11-30] [Performance] Avoid repeated action scans when opening large expense reports #107296

Todo

Description

@roryabraham

Problem

Opening an expense report with many expenses can freeze the page for several seconds while it loads. The delay grows with the number of expenses.

getAllNonDeletedTransactions calls getIOUActionForTransactionID for each expense, scanning the report actions each time. Multiple callers run this work repeatedly as the report loads.

Reproduction and measurements

  1. In Chrome, open a production build on staging with the cache cleared and 4× CPU slowdown.
  2. Go to Spend > Reports and open a report containing 400 expenses.
  3. Observe the page freezing while the report loads.

In five alternating runs, the report appeared after 664 ms and the page froze for 6.3 seconds on main. A proposed fix reduced these to 464 ms and 4.2 seconds, respectively, with the same API calls.

Proposed solution

Scan report actions once in getAllNonDeletedTransactions, retaining the first matching action for each expense as getIOUActionForTransactionID does, then look up each expense's action. Preserve existing behavior and verify large reports display all expenses and correct totals, including offline.

Draft PR · Slack discussion

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. added theissue type on Nov 18, 2026
  3. twilight2294 commented on Nov 18, 2026

    @twilight2294
    Contributor
  4. melvin-bot commented on Nov 18, 2026

    @melvin-bot

    @roryabraham — to hire @twilight2294 on Upwork, add the External label so a job is created and the offer is sent automatically.

  5. added
    Reviewing
    Weekly
    and removed
    Daily
    on Nov 18, 2026
  6. moved this from CRITICAL to AWAITING DEPLOYMENT in [#whatsnext] #qualityon Nov 23, 2026
  7. added
    Daily
    and removed
    Reviewing
    Weekly
    on Nov 23, 2026
  8. 1 remaining item

  9. melvin-bot commented on Nov 23, 2026

    @melvin-bot

    @roryabraham @twilight2294

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.52-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-11-30. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  10. expensify-chore-bot commented on Nov 27, 2026

    @expensify-chore-bot

    @twilight2294 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. added
    Awaiting Payment
    on Nov 29, 2026
  12. expensify-chore-bot commented on Nov 29, 2026

    @expensify-chore-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. expensify-chore-bot commented on Nov 29, 2026

    @expensify-chore-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  14. mallenexpensify commented on Dec 2, 2026

    @mallenexpensify
    Contributor

    Matt's AI agent:

    Will pay tomorrow, apologies for the delay

  15. mallenexpensify commented on Dec 2, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @twilight2294 due $175 via NewDot

    @twilight2294 being added to NewDot payments, will leave open til they are

  16. added
    Weekly
    and removed
    Daily
    on Dec 2, 2026
  17. mallenexpensify commented on Dec 3, 2026

    @mallenexpensify
    Contributor

    Matt's AI agent:

    Prep notes for the CM. This is not a payment approval. Do not request payment until the CM posts the final amount.

    Ready.

    Job price: $175.

    • twilight2294 (Contributor): 100%, via Upwork

    Price basis: standard, no Help Wanted.

    Perf PR, no checklist needed.

    Your summary says NewDot and C+. Data.php says Upwork, and twilight2294 wrote the PR.

    Next: pay. No Caps+Y.

    Evidence
    • Resolving PR 107294: twilight2294, merged 2026-11-19, approved by roryabraham. No revert. Production 2026-11-23.
    • No C+ on the PR. No deploy blockers.

    PAYPREP v1

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

Metadata

Metadata

Labels

Awaiting PaymentWeekly

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions