Skip to content

[$250] Withdrawn - Withdrawn exposed filter is not displayed for the first time applying #79820

Closed

Description

@lanitochka17

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.4-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: https://test-management.browserstack.com/projects/2219752/folder/13176922/test-cases/44231135
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: iPhone 15 iOS 26.1
App Component: Search

Action Performed:

  1. Sign in to ND with a new gmail account
  2. On onboarding select "Manage my team's expenses" - 1-10 - QBO
  3. create an expense in the workspace chat
  4. Navigate to the Reports/ Expenses
  5. Open advanced filters, tap Withdrawn - Last month - Save - View results

Expected Result:

Filter pill with the value "Withdrawn: Last month" appears in the filters bar

Actual Result:

Withdrawn exposed filter appears in the filter bar briefly, then disappears, when applying for the first time

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7051614_1768629587299.Withdrawn_1.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022015865978501209160
  • Upwork Job ID: 2015865978501209160
  • Last Price Increase: 2026-03-05
Issue OwnerCurrent Issue Owner: @mohammadjafarinejad

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 17, 2026
  2. melvin-bot commented on Jan 17, 2026

    @melvin-bot

    Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. melvin-bot commented on Jan 17, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 17, 2026

    @melvin-bot

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

  5. github-actions commented on Jan 17, 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.
  6. OSBotify commented on Jan 17, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #78091 - "[CFI] Add group-by columns (V2)" by @mohammadjafarinejad (High confidence)
    Related Issues: None identified

    Recommendation: REVERT

    PR #78091 introduces new group-by functionality and modifies the Search component with the useMultipleSnapshots hook. While the PR does not directly modify SearchFiltersBar.tsx, it changes how search data is fetched and rendered, which appears to have introduced a timing/synchronization issue affecting filter pill display.

    Labels: Keeping DeployBlockerCash - this is a frontend bug requiring an App PR fix.

    Detailed Analysis

    Evidence

    • Bug affects the "Withdrawn" filter pill disappearing briefly when first applied on iOS app (v9.3.4-0)
    • Reproducible on staging but NOT production, indicating the cause is in the current staging deploy (v9.3.4-0)
    • PR [CFI] Add group-by columns (V2) #78091 is the most significant search-related change in this deploy, merged on 2026-01-15

    Root Cause Analysis

    Looking at src/components/Search/SearchPageHeader/SearchFiltersBar.tsx (lines 543-546):

    const shouldDisplayWithdrawnFilter = !!searchAdvancedFiltersForm.withdrawnOn || !!searchAdvancedFiltersForm.withdrawnAfter || !!searchAdvancedFiltersForm.withdrawnBefore;

    The logic for displaying the withdrawn filter pill depends on searchAdvancedFiltersForm (Onyx form state). When filters are first applied:

    1. The filter values exist in the URL query parameters (queryJSON)
    2. The filterFormValues hook derives values from queryJSON
    3. However, searchAdvancedFiltersForm (the Onyx form state) may not be immediately synchronized
    4. This creates a brief moment where shouldDisplayWithdrawnFilter returns false even though the filter is active
    5. Once Onyx updates, the filter pill appears again

    Verification

    • PR [CFI] Add group-by columns (V2) #78091 modifies core Search components including src/components/Search/index.tsx
    • Adds new useMultipleSnapshots hook for group-by functionality
    • Changes how search results are processed and rendered
    • These changes likely altered the timing of when Onyx state updates relative to component renders

    Why This Affects Withdrawn Filter Specifically

    The withdrawn filter (like posted, date, etc.) depends on checking multiple form fields (On/After/Before). This makes it more susceptible to timing issues where the form state hasn not fully populated yet.

  7. twisterdotcom commented on Jan 19, 2026

    @twisterdotcom
    Contributor

    Also cc @luacmartins from columns fame.

  8. OSBotify commented on Jan 19, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #78091 - "[CFI] Add group-by columns (V2)" by @mohammadjafarinejad (High confidence)
    Related Issues: None identified

    Recommendation: REVERT

    PR #78091 introduces URL normalization logic that triggers navigation when the queryJSON differs from the URL. This creates a race condition where the Onyx form state (searchAdvancedFiltersForm) becomes temporarily out of sync with the URL-derived filter values, causing the withdrawn filter pill to briefly disappear and then reappear.

    Labels: Keeping DeployBlockerCash - this is a frontend bug requiring an App PR revert or fix.

    📋 Detailed Analysis

    Evidence

    • Bug affects the "Withdrawn" filter pill disappearing briefly when first applied on iOS app (v9.3.4-0)
    • Reproducible on staging but NOT production, confirming the cause is in the current staging deploy
    • PR [CFI] Add group-by columns (V2) #78091 is the most significant search-related change in this deploy, merged on 2026-01-15

    Verification

    PR #78091 modifies core Search infrastructure:

    • File: src/pages/Search/SearchPage.tsx - Adds new useEffect for URL normalization (lines 226-236 in the diff)
    • File: src/components/Search/index.tsx - Introduces useMultipleSnapshots hook and changes data flow
    • File: src/hooks/useMultipleSnapshots.ts - New hook for fetching group-by transaction snapshots

    The new URL normalization effect:

    useEffect(() => {
        if (!queryJSON || !route.params.q) {
            return;
        }
        const normalizedQueryString = buildSearchQueryString(queryJSON);
        if (normalizedQueryString !== route.params.q) {
            Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: normalizedQueryString}), {forceReplace: true});
        }
    }, [queryJSON, route.params.q]);

    This effect triggers navigation when Peggy parser normalizes the query (e.g., adding default sortBy/sortOrder).

    Root Cause

    The bug occurs due to a timing issue between two data sources in SearchFiltersBar.tsx:

    1. Line 90: searchAdvancedFiltersForm - Onyx form state (used to determine if withdrawn filter should display)
    2. Line 102: filterFormValues - Derived from queryJSON via useFilterFormValues hook

    The race condition:

    1. User applies withdrawn filter → URL updates with filter values
    2. filterFormValues (from queryJSON) immediately reflects the filter
    3. Filter pill appears because shouldDisplayWithdrawnFilter evaluates to true
    4. PR [CFI] Add group-by columns (V2) #78091 URL normalization effect detects query difference and triggers navigation
    5. During navigation/re-render, searchAdvancedFiltersForm (Onyx) hasn not synced yet
    6. shouldDisplayWithdrawnFilter temporarily becomes false → pill disappears
    7. Once Onyx updates, pill reappears

    Code path (SearchFiltersBar.tsx line 548):

    const shouldDisplayWithdrawnFilter = !!searchAdvancedFiltersForm.withdrawnOn || 
        !!searchAdvancedFiltersForm.withdrawnAfter || 
        !!searchAdvancedFiltersForm.withdrawnBefore;

    This checks the Onyx form state instead of the URL-derived values from filterFormValues.

    Why Withdrawn Filter Specifically

    The withdrawn filter is more susceptible because it checks multiple form fields (On/After/Before), making it more likely to encounter the timing issue where none of these fields are populated yet during the transition.

  9. 73 remaining items

  10. melvin-bot commented on Mar 24, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. mallenexpensify commented on Mar 24, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @mohammadjafarinejad paid $250 via Upwork
    Contributor+: @parasharrajat due $250 via NewDot

    @mohammadjafarinejad can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022036550020147765911

  12. melvin-bot commented on Mar 27, 2026

    @melvin-bot

    @mohammadjafarinejad Whoops! This issue is 2 days overdue. Let's get this updated quick!

  13. melvin-bot commented on Mar 27, 2026

    @melvin-bot

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

  14. parasharrajat commented on Mar 28, 2026

    @parasharrajat
    Member

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: Couldn't figure out the PR. It was there since a long time.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: Not needed

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    1. Sign in with a new Gmail account
    2. On onboarding select Manage my team's expenses → 1-10 → QBO
    3. Create an expense in the workspace chat
    4. Navigate to Search → Expenses
    5. Open advanced filters, tap Withdrawn → Last month → Save → View results
    6. Verify the filter pill "Withdrawn: Last month" appears in the filter bar and stays visible (does not flash and disappear)

    Do we agree 👍 or 👎

  15. parasharrajat commented on Mar 28, 2026

    @parasharrajat
    Member

    @mallenexpensify Can we close this?

    cc: @mohammadjafarinejad Did you accept the job?

  16. mohammadjafarinejad commented on Mar 29, 2026

    @mohammadjafarinejad
    Contributor

    @mallenexpensify Accepted the offer, thanks!

  17. luacmartins commented on Mar 30, 2026

    @luacmartins
    Contributor

    Seems like we're good to close.

  18. mallenexpensify commented on Apr 2, 2026

    @mallenexpensify
    Contributor

    @mohammadjafarinejad paid, summary updated above. Thx.

  19. parasharrajat commented on Apr 20, 2026

    @parasharrajat
    Member

    Payment requested as per #79820 (comment)

  20. garrettmknight commented on Apr 23, 2026

    @garrettmknight
    Contributor

    $250 approved for @parasharrajat

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions