Skip to content

[$250] [Insights] Reports - Keyword filter is applied with "limit:" after clearing limit filter and click View results #80675

Closed

Description

@vincdargento

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.10-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #80262
Email or phone of affected tester (no customers): osdijosijdodninjso@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Go to Reports > Top categories.
  4. Open Filters.
  5. Open Limit filter.
  6. Clear the field and save it.
  7. Click View results.
  8. Open Filters.

Expected Result:

No extra filter will be applied after clearing limit filter and clicking View results.

Actual Result:

Keyword filter is applied with "limit:" after clearing limit filter and clicking View results.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022016310634435774836
  • Upwork Job ID: 2016310634435774836
  • Last Price Increase: 2026-01-28
Issue OwnerCurrent Issue Owner: @

Activity

  1. melvin-bot commented on Jan 27, 2026

    @melvin-bot

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

  2. melvin-bot commented on Jan 27, 2026

    @melvin-bot

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

  3. github-actions commented on Jan 27, 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.
  4. ShridharGoel commented on Jan 27, 2026

    @ShridharGoel
    Contributor

    @TaduJR Can you have a look?

  5. OSBotify commented on Jan 27, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #80262 - "feat: [Insights] [Release 1] Top Categories - Add a limit filter to search" by @TaduJR (High confidence)
    Related Issues: None

    Recommendation: ROLL FORWARD

    The fix is simple and low-risk - just adding a check for empty strings. A revert would remove the entire limit filter feature which is more disruptive than a quick fix.

    Labels: No label changes needed - keeping DeployBlockerCash since this is a frontend bug in the App repository.

    Detailed Analysis

    Evidence

    PR #80262 added the limit filter functionality to the search feature. The bug appears when clearing the limit field - instead of removing the filter, it adds limit: (with empty value) to the query string, which then gets interpreted as a keyword filter.

    Verification

    Affected file: /home/runner/work/App/App/src/libs/SearchQueryUtils.ts (lines 747-750)

    Root cause code:

    const limitValue = limit ?? options?.limit;
    if (limitValue !== undefined) {
        filtersString.push(`${CONST.SEARCH.SYNTAX_ROOT_KEYS.LIMIT}:${limitValue}`);
    }

    The issue: When a user clears the limit field in the UI, it becomes an empty string "". The check limitValue !== undefined evaluates to true for empty strings, so it adds limit: to the query. This gets parsed as a keyword filter with value "limit:".

    Why this is a Frontend bug:

    1. The form field type is string (confirmed in SearchAdvancedFiltersForm.ts line 679)
    2. The bug is in the App codebase query building logic
    3. No backend API changes are needed - the fix is purely client-side validation

    Root Cause

    The buildQueryStringFromFilterFormValues function in SearchQueryUtils.ts does not validate that the limit value is non-empty before adding it to the query string. It only checks for undefined, but form fields return empty strings when cleared, not undefined.

    The fix should check if the limit value is a non-empty string and a valid positive integer:

    const limitValue = limit ?? options?.limit;
    if (limitValue !== undefined && limitValue !== "" && Number(limitValue) > 0) {
        filtersString.push(`${CONST.SEARCH.SYNTAX_ROOT_KEYS.LIMIT}:${limitValue}`);
    }
  6. puneetlath commented on Jan 28, 2026

    @puneetlath
    Contributor

    I don't think it's big enough to be a blocker, but we should fix @TaduJR.

  7. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jan 28, 2026
  8. changed the title [-]Reports - Keyword filter is applied with "limit:" after clearing limit filter and click View results[/-] [+][Insights] Reports - Keyword filter is applied with "limit:" after clearing limit filter and click View results[/+] on Jan 28, 2026
  9. 1 remaining item

  10. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 28, 2026
  11. melvin-bot commented on Jan 28, 2026

    @melvin-bot
  12. changed the title [-][Insights] Reports - Keyword filter is applied with "limit:" after clearing limit filter and click View results[/-] [+][$250] [Insights] Reports - Keyword filter is applied with "limit:" after clearing limit filter and click View results[/+] on Jan 28, 2026
  13. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 28, 2026
  14. melvin-bot commented on Jan 28, 2026

    @melvin-bot

    Current assignee @ShridharGoel is eligible for the External assigner, not assigning anyone new.

  15. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 28, 2026
  16. TaduJR commented on Jan 29, 2026

    @TaduJR
    Contributor

    PR is ready.

  17. trjExpensify commented on Feb 5, 2026

    @trjExpensify
    Contributor

    On prod. Settling up with Tadu and Shridhar at the end, closing!

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

Metadata

Metadata

Labels

EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions