Skip to content

NewDot web freezes/crashes on Spend > Expenses when applying Filters/Date range on large accounts #97447

Closed

Description

@MelvinBot

Problem

On NewDot web, Spend > Expenses is extremely slow to load on a large account (a minute or more), and applying a Filter / Date range causes the Filters popover to freeze and the page to crash.

Steps to reproduce

  1. On a large account, go to Spend > Expenses
  2. Wait for the expenses list to load (very slow)
  3. Open Filters and select a Date range

Expected result

The filter applies and the list updates without freezing or crashing.

Actual result

The Filters popover freezes/lags, then the page crashes. On retry the popover may not freeze but still lags on filter change and crashes again.

Platform

  • Web

Notes

Slack thread: https://expensify.slack.com/archives/C05LX9D6E07/p1785167386765389

Issue OwnerCurrent Issue Owner: @BartekObudzinski

Activity

  1. self-assigned this
    on Jul 30, 2026
  2. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    Triggered auto assignment to @mjasikowski (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Jul 30, 2026

    @melvin-bot

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

  4. github-actions commented on Jul 30, 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. mountiny commented on Jul 30, 2026

    @mountiny
    Contributor

    Based on the investigation, this seems to be a deploy blocker happening from #93909, when the pr was reverted, the crash did not occur

  6. MelvinBot commented on Jul 30, 2026

    @MelvinBot
    ContributorAuthor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #93909 - "Add filter negation feature" by @bernhardoj (High confidence)
    Related Issues: #93916 (renderer OOM crash under large Onyx dataset — likely the same crash surface)

    Recommendation: REVERT

    The regression lives entirely in Expensify/App (the Search filter popover / filter-bar code path), the PR is in the current StagingDeployCash (#97375), and the issue owner already confirmed empirically that reverting #93909 makes the crash go away. Reverting is the safe, fast path to unblock the deploy.

    Assigned: @bernhardoj (PR author), @aimane-chnaif and @JS00001 (approving reviewers) from the causing PR.
    Labels: No change. DeployBlockerCash is kept because an App PR caused the issue (Frontend bug); DeployBlocker was not present.

    Revert target: merge commit 992e4dd2bef3dfd712d9f0c2c45b0247b63f7f20 (PR #93909).

    📋 Detailed Analysis

    Evidence

    • Confirmed in the current release: Add filter negation feature #93909 is listed (item 46) on the open deploy checklist #97375 (Deploy Checklist: New Expensify 2026-07-29), and was merged 2026-07-28T15:50:06Z — immediately before the 2026-07-29 staging cut where the bug first reproduced. This is staging-only (matches a deploy blocker; not yet on production).
    • First-party revert confirmation: The issue owner @mountiny (internal MEMBER) stated: "this seems to be a deploy blocker happening from Add filter negation feature #93909, when the pr was reverted, the crash did not occur." Reverting removing the symptom is the strongest possible causation signal.
    • The PR rewrites exactly the failing flow: Add filter negation feature #93909 touches the Spend > Expenses (Search) filter popover and filter-bar code end-to-end — the same UI that freezes when you open Filters and pick a Date range.

    Verification

    The reported flow (Spend > Expenses → Filters → Date range) is driven by the files #93909 rewrote. Confirmed the PR modifies the affected code paths:

    • src/components/Search/SearchPageHeader/useSearchFiltersBar.tsx — the filter bar / popover host that renders on the Expenses page (FilterPopup reworked from filterKey → baseFilterKey, switched CommonPopup → new ListPopup).
    • src/components/Search/FilterDropdowns/ListPopup.tsx — new file replacing CommonPopup.tsx (deleted); this is the popover body that renders the filter option list.
    • src/components/Search/FilterComponents/ListFilterContent.tsx — renamed from FilterComponents/index.tsx, now wraps every list filter in a new NegatableFilter.
    • src/components/Search/FilterComponents/NegatableFilter.tsx — new wrapper rendered around each filter's option list.
    • src/libs/SearchUIUtils.ts and src/libs/SearchQueryUtils.ts — filter value/label computation helpers (getFilterNegatableValue, getLabelValue, isFilterNegated, getFilterFormValues, mapFiltersFormToLabelValueList) reworked.

    All of these files are present at the investigated App HEAD 48c8baa7a570420be632c1469dd38f6c5862d44c, confirming #93909 is in the branch under test.

    Root Cause

    This PR is a broad refactor of the Search filter popover to add the "is / is not" negation feature. Two structural changes make the large-account freeze/crash plausible and align with #93916 (renderer OOM):

    1. Extra render layer + fresh local state per popover open. The new ListPopup (permalink) computes getFilterNegatableValue(...) on every render and seeds two useState values, then renders ListFilterContent → NegatableFilter → the actual selector (WorkspaceSelector, UserSelector for To/From, TagSelector, etc.). On a large account these selectors materialize very large option lists (all members, all workspaces, all tags). The added wrapper layer and the negation-toggle state change (onNegationChange) force the full option list to re-render synchronously when the user interacts with the popover — exactly the "popover freezes, then page crashes" symptom.

    2. Label/value recomputation over the whole form on every filter change. mapFiltersFormToLabelValueList now calls getLabelValue → isFilterNegated per key (SearchUIUtils.ts ~L5622-5738), and getFilterNegatableValue was rewritten (~L5610). This runs when the filter bar re-renders after a filter (e.g. Date range) is applied, which on a large dataset compounds with the already-heavy Expenses list render and pushes the renderer over its memory budget (the OOM in [Due for payment 2026-08-25] [$500] NewDot web tab crashes silently (renderer OOM kill) under high memory / large Onyx dataset #93916).

    The slow initial load of Spend > Expenses on large accounts is a separate/pre-existing pressure (heavy backend query for high report/expense volume, noted in the issue), but the freeze-then-crash on applying a filter is introduced by #93909 — hence the clean disappearance on revert.

    Because this PR is a large refactor with wide surface area (43 files) and no obvious single-line targeted fix, a full revert of #93909 is preferred over a spot fix. A forward fix (memoizing the popover option lists / avoiding the extra re-render layer) can be reworked and re-landed after the deploy is unblocked.

  7. BartekObudzinski commented on Jul 30, 2026

    @BartekObudzinski
    Contributor

    Reproduction steps

    1. Go to Spend.
    2. Open Expenses.
    3. Wait for the expenses list to load.
    4. Click Filters.
    5. Hover over From or To.
    6. Observe that the user selection list appears, then the page freezes and crashes.
  8. BartekObudzinski commented on Jul 30, 2026

    @BartekObudzinski
    Contributor

    I found this Sentry issue, which contains matching crash events. I reproduced the crash on staging and dev, while production works fine. The problem was not related to selecting a date range. It occurred when hovering over the From or To sections in the Filters popover. After reviewing the recent changes, PR #93909 stood out because it modifies this exact area. Reverting it locally stopped the crash

    fix already merged #97432

  9. mountiny commented on Jul 30, 2026

    @mountiny
    Contributor

    Fixed in staging

  10. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions