Skip to content

Reports - App crashes after triggering an invalid "Type:" search on "Reports". #65165

Closed

Description

@jponikarchuk

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.1.72-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/6378092&group_by=cases:section_id&group_order=asc&group_id=319502
Email or phone of affected tester (no customers): ibellicotest+1189@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome (mWeb - Hybrid App) / Windows 10 - Chrome
App Component: Search

Action Performed:

  1. Open the Expensify app.
  2. Navigate to "Reports"
  3. Tap on the search input.
  4. Input a "Type:" search that won´t trigger any result. (For example: type:asdff)
  5. Check the app´s behaviour after this last action.

Expected Result:

After triggering a "type:" search with no results on "Reports", user will land on a "Nothing to show" page.

Actual Result:

After triggering an invalid "type:" search on "Reports", app crashes.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

Logs.txt

View all open jobs on GitHub

Activity

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

    @melvin-bot

    Triggered auto assignment to @strepanier03 (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 Jun 30, 2025

    @melvin-bot

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

  4. github-actions commented on Jun 30, 2025

    @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. melvin-bot commented on Jun 30, 2025

    @melvin-bot

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

  6. mkzie2 commented on Jun 30, 2025

    @mkzie2
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After triggering an invalid "type:" search on "Reports", app crashes.

    What is the root cause of that problem?

    With an invalid search type, the app crashes because we don't have the translation here. The bug can't be reproduced in production because we don't intentionally cause the app to crash with a 'not found' translation in production.

    value: translate(`common.${type}`),

    What changes do you think we should make in order to solve the problem?

    We shouldn't render the filter bar if the type/group-by is invalid because the backend will return the error with invalid type/group-by

    const isInvalidQuery = (!!queryJSON?.type && !Object.values(CONST.SEARCH.DATA_TYPES).includes(queryJSON?.type)) ||  (queryJSON?.groupBy && !Object.values(CONST.SEARCH.GROUP_BY).includes(queryJSON?.groupBy));
    {!isInvalidQuery && (
        <SearchFiltersBar
            queryJSON={queryJSON}
            headerButtonsOptions={headerButtonsOptions}
        />
    )}
    

    value: translate(`common.${type}`),

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    We can check if the type/group-by is invalid; we will not translate the type/group-by

    value: translate(`common.${type}`),

    value: groupBy ? translate(`search.filters.groupBy.${groupBy}`) : null,

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  7. BlameGPT commented on Jun 30, 2025

    @BlameGPT
    Contributor

    Possible culprit PRs for this issue

    • Suggested Search: Unapproved accruals #64670: Massive refactor of search (SearchList, EmptySearchView, SearchQueryUtils, etc.) altering how results and empty states are handled, so an invalid Type search crashing is a likely regression from these changes.
    • Search: Added Card to GROUP_BY #64911: Extends search grouping logic in SearchUIUtils and TransactionGroupListItem which can affect result processing when filters return no data, potentially causing the crash on an invalid Type query.

    Exploratory PRs

  8. rushatgabhane commented on Jun 30, 2025

    @rushatgabhane
    Member

    @s77rt @ikevin127 is it possible #64911 caused this?

  9. 5 remaining items

  10. rushatgabhane commented on Jun 30, 2025

    @rushatgabhane
    Member

    oh yeah its in prod, makes sense

  11. s77rt commented on Jun 30, 2025

    @s77rt
    Member

    Just checked again, on production it does not crash because we have a fail safe guard in case a language translation path does not exist

    // Phrase is not found in default language, on production and staging log an alert to server
    // on development throw an error
    if (Config.IS_IN_PRODUCTION || Config.IS_IN_STAGING) {
    const phraseString = Array.isArray(path) ? path.join('.') : path;
    Log.alert(`${phraseString} was not found in the ${locale} locale`);
    if (userEmail.includes(CONST.EMAIL.EXPENSIFY_EMAIL_DOMAIN)) {
    return CONST.MISSING_TRANSLATION;
    }
    return phraseString;
    }

    However another crash happens because in isFilterSupported the passed type is not a valid type

    ].filter((filterItem) => isFilterSupported(filterItem.keyForList, type));

  12. s77rt commented on Jun 30, 2025

    @s77rt
    Member

    So effectively this is a regression from #64670

  13. s77rt commented on Jun 30, 2025

    @s77rt
    Member

    On DEV:

    On Staging:

  14. mkzie2 commented on Jun 30, 2025

    @mkzie2
    Contributor

    @s77rt That PR was deployed to prod, and this issue isnt reproducible on prod. I do agree that directly getting the translation based on type is the issue, but somewhere we probably removed checks that made sure type is valid before setting it

    @JS00001 The app doesn't crashes in production as I explained here

    The bug can't be reproduced in production because we don't intentionally cause the app to crash with a 'not found' translation in production.

  15. s77rt commented on Jun 30, 2025

    @s77rt
    Member

    @mkzie2 The not found view is only displayed when online, while offline the search filters bar will be rendered

    Image
  16. s77rt commented on Jun 30, 2025

    @s77rt
    Member
  17. JS00001 commented on Jun 30, 2025

    @JS00001
    Contributor

    Merged, not a deploy blocker though because we prevent the error on prod

  18. JS00001 commented on Jun 30, 2025

    @JS00001
    Contributor

    CPd to staging, and confirmed issue no longer exists. Closing since this was a regression so no payment needed

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions