Skip to content

Describe search - Oops... Something went wrong shown when searching on Reports #102192

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.93-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: -
Email or phone of affected tester (no customers): jsdoijnodsdisojo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Spend > Reports.
  3. Open Filters > Describe your search.
  4. Type report more than RM11.00 > click Apply.

Expected Result:

Search will be performed without issue.

Actual Result:

Oops... Something went wrong shown when searching on Reports.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7268236_1790256023290.8.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7268236

Activity

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

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/854d1ae42f7bf7a15fcca1deb53a8f95a5fe2610cfd132fee61c565d9abe4d09

  3. github-actions commented on Sep 24, 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. melvin-bot commented on Sep 24, 2026

    @melvin-bot

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

  5. melvin-bot commented on Sep 24, 2026

    @melvin-bot

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

  6. MelvinBot commented on Sep 24, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: [Payment due @truph01] Add natural language filter entry point to Spend page - by @marcaaron (High confidence)
    Related Issues: Spend - Enter key activates Apply button and also creates a new line, Android & iOS - Spend - Unable to scroll down Describe your search page in landscape, Spend- Unable to search for deleted expense, wrong filter when searching for approved expense, Describe search - category: filter is applied when searching for expense with no category, Describe search - Amount filter is not applied when searching for expenses with price range

    Recommendation: REVERT

    The "Describe your search" entry point is brand new in 9.4.93-0 and has already produced six separate deploy blockers on this checklist; reverting the entry point is a clean, additive-only rollback that unblocks the deploy while the natural-language parsing is hardened.

    Assigned: @marcaaron (PR author), @carlosmiceli (approving reviewer), @truph01 (approving reviewer) from highest-confidence causing PR only
    Labels: No changes. DeployBlockerCash is kept (an App PR introduced the feature and the fix/revert lands in Expensify/App). DeployBlocker was not present, so nothing was removed.

    📋 Detailed Analysis

    Evidence

    • The bug is staging-only and the reporter marked it N/A - new feature, doesn't exist in prod. The "Describe your search" feature was introduced by #94217, which is item 66 (the last App PR) in the 9.4.93-0 checklist and merged at 2026-09-24T12:08:32Z — about two hours before this issue was filed at 14:12Z.
    • Five sibling deploy blockers filed by the same tester in the same window all exercise the identical Filters > Describe your search entry point, and #102193 / #102190 explicitly name #94217 in the "caught during regression testing" field. #102193 is the same RM-prefixed amount scenario on the Expenses tab, where the amount filter is silently dropped instead of erroring.
    • No other PR in the checklist touches the natural-language search path. #101575 (Search query resolution) and #101759 (Enter-to-submit) touch Search, but neither introduces the describe/parse flow — #101759 merged at 13:57Z, after the staging build was cut.

    Verification

    Affected files, all added or modified by #94217:

    git log confirms SearchNLFilterContent.tsx and SearchNLFilterPage.tsx were both created on the marcaaron-nl-filters-ui branch and first reached main in merge commit 031e94e for #94217. The exact string in the report matches common.genericErrorMessage ("Oops... something went wrong and your request could not be completed. Please try again later."), and the only place that string is rendered anywhere in the Search UI is SearchNLFilterContent.tsx#L78 — so the failure is inside this PR's submit handler, not a generic Search page error.

    Root Cause

    The natural-language → structured-query translation itself is done server-side by the ParseExpenseFilters API command; the App only posts the raw text and consumes whatever URL comes back. The App-side handling of that response is what turns a bad/unsupported parse into a hard "Oops" instead of a usable result:

    1. No data-type context is sent. handleSubmit only forwards nlQuery and a policyID; the payload type has no field for the current data type or groupBy (ParseExpenseFiltersParams.ts). So a report-level phrase typed on the Reports tab ("report more than RM11.00") is parsed with no knowledge that the user is on a report-grouped search, which is why this reproduces on Reports while the equivalent expense-level phrasing on the Expenses tab merely drops the amount (#102193).

    2. The returned URL is parsed unguarded. Line 70 does new URL(result.searchURL).searchParams.get('q'). new URL() throws TypeError: Invalid URL for any non-absolute or malformed value, and the response is never validated before this call.

    3. Every in-handler throw collapses into the generic error. parseExpenseFilters already swallows its own rejections (.catch(() => ({success: false, message: ''}))), so the component's .catch at lines 76-79 can only ever fire for an exception thrown inside the .then body — i.e. the new URL(...) call. That is the "Oops... Something went wrong" the tester sees. The mirror-image gap is on line 73: setErrorMessage(result.message) with no fallback, so an empty server message renders no feedback at all.

    Because the parsing quality itself lives behind the API, a targeted App-side fix (validating result.searchURL, sending the active data type / groupBy, and falling back to a real message) would only convert the crash into a graceful "I couldn't understand that" — it would not make report more than RM11.00 actually work. Combined with the five sibling blockers from the same feature, reverting #94217 is the lower-risk path: it is purely additive (a new route, screen, component, API wrapper and copy), so the revert is clean, and the feature can re-land once the parsing handles non-USD currency prefixes and report-level queries.

  7. MelvinBot commented on Sep 24, 2026

    @MelvinBot
    Contributor

    Deploy blocker analysis

    Correction: this supersedes my earlier comment. The revert recommendation stands, but the root cause there (an unguarded new URL() throw) was wrong. Live reproduction shows the URL parses fine — the error comes from the Search API rejecting the generated query.

    Root cause: the "Describe your search" parser generates an amount> filter for a Reports search, but amount is not a valid filter for type:expense-report — reports use total. The backend Search command rejects the query and the results page renders "Oops... Something went wrong".

    Causing PR: [Payment due @truph01] Add natural language filter entry point to Spend page by marcaaron, merged 2026-09-24 12:08 UTC — the last App PR in the 9.4.93-0 checklist, and the only one touching this path.

    The RM currency prefix is a red herring. I reproduced live: report more than RM11.00 and the control report more than 11.00 produce the identical query and the identical failure. Any amount phrase on the Reports tab breaks.

    Query typed Generated q Search result
    report more than RM11.00 type:expense-report sortBy:date sortOrder:desc amount>1100 ❌ jsonCode 402
    report more than 11.00 (control) type:expense-report sortBy:date sortOrder:desc amount>1100 ❌ jsonCode 402
    baseline, no amount type:expense-report sortBy:date sortOrder:desc ✅ 200

    Oops error for 'report more than RM11.00' on Reports Same Oops error for control query 'report more than 11.00'

    Recommendation: revert #94217. It is purely additive (route, page, component, API wrapper, copy) so it reverts cleanly, and it is behind six open blockers on this checklist — 102174, 102186, 102187, 102190, this one, and 102193. The parse quality itself lives in the backend ParseExpenseFilters command, so App alone cannot make these queries correct before the deploy.

    Investigation details

    Why amount is invalid on Reports. The per-type filter allowlist gives type:expense-report the TOTAL, AMOUNT_DEBITED, and AMOUNT_REIMBURSED keys — never AMOUNT, which belongs to expense and invoice: src/hooks/useAdvancedSearchFilters.ts:76-104. So the NL flow emits a filter the normal Reports UI can never produce.

    Why the parser doesn't know it is on Reports. The request payload carries only the raw text, the policy, and today's date — no data type, no searchKey, no groupBy:

    With no type context the backend always parses at expense level, so more than 11.00 becomes amount>1100 even though the user is on the Reports tab.

    Why it surfaces as a full error page. SearchNLFilterContent.tsx:63-74 navigates straight to whatever q the server returns, with no check that the filters are legal for the active data type. The invalid query only fails later, at POST /api/Search, where nothing can recover it.

    Alternative explanations ruled out.

    • Currency-symbol parsing bug — ruled out by the control query, which omits RM and fails identically.
    • Unguarded new URL() throw — ruled out: the app successfully navigated to /search?q=…, so result.searchURL was a valid absolute URL and no throw occurred.
    • Empty account / no reports — ruled out: the same search with the amount filter removed returns 200 and the normal empty state.

    Reproduction environment. Verified on NewDot web with a fresh account. The generated query, the 402, and the error screen match the Applause report on staging exactly.

    Minimum viable fix, if reverting is rejected. Pass the active data type (or searchKey) in the ParseExpenseFilters payload so the backend can emit total> for report searches, and validate the returned query's filter keys against the active type's allowlist before navigating — falling back to an inline "couldn't understand that" message instead of a hard error page. The backend change is required for the query to actually work, so this cannot be fixed in App alone.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/102192) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run · no recording available

  8. 14 remaining items

  9. melvin-bot commented on Sep 28, 2026

    @melvin-bot

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

  10. melvin-bot commented on Sep 30, 2026

    @melvin-bot

    @marcaaron Eep! 4 days overdue now. Issues have feelings too...

  11. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    @marcaaron Still overdue 6 days?! Let's take care of this!

  12. melvin-bot commented on Oct 3, 2026

    @melvin-bot

    @marcaaron Still overdue 6 days?! Let's take care of this!

  13. melvin-bot commented on Oct 6, 2026

    @melvin-bot

    @marcaaron 10 days overdue. Is anyone even seeing these? Hello?

  14. melvin-bot commented on Oct 8, 2026

    @melvin-bot

    @marcaaron this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  15. melvin-bot commented on Oct 8, 2026

    @melvin-bot

    @marcaaron 12 days overdue. Walking. Toward. The. Light...

  16. melvin-bot commented on Oct 12, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @marcaaron eroding to Weekly issue.

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.EngineeringWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions