Skip to content

[Due for payment 2025-08-01] [$250] Reports - Searching a non existing user on "From", opens a report behind opened modal #65619

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

Action Performed:

Prerequisite: Account has at least one workspace.
Prerequisite 2: Workspace has at least one expense created.

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Reports"
  3. Tap on "From"
  4. Input a user name that will not trigger any result.
  5. Tap on enter on keyboard, to trigger the search.
  6. Note that after triggering the search, an expense report opens on the background while "From" modal is still opened.

Expected Result:

Only a "No results found" message should be seen when searching for a non existing user in the "From" filter on "Reports"

Actual Result:

When searching for an user that doesn’t trigger any result on "From" filter on "Reports", an expense report is opened on the background while the "From" modal is still opened.

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021942680116458279588
  • Upwork Job ID: 1942680116458279588
  • Last Price Increase: 2025-07-08
  • Automatic offers:
    • dominictb | Reviewer | 107996312
    • daledah | Contributor | 107996315
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 8, 2025
  2. melvin-bot commented on Jul 8, 2025

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. Burhan-Rashid commented on Jul 8, 2025

    @Burhan-Rashid
    Contributor

    Proposal

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

    Reports - Searching a non existing user on "From", opens a report behind opened modal

    What is the root cause of that problem?

    When we search for some non existing user in the UserSelectPopup, the focusedIndex becomes -1 here and makes the shouldBubble to get value true, which makes our enter key press event to bubble to the parent and trigger the enter key there as well which open the report in the background.

    shouldBubble: !flattenedSections.allOptions.at(focusedIndex) || focusedIndex === -1,

    shouldBubble: !flattenedSections.allOptions.at(focusedIndex) || focusedIndex === -1,

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

    We need to add a new prop to the BaseSelectionList component here

    shouldBubble = true

    with default value as true.
    We need to make changes here

            shouldBubble: (!flattenedSections.allOptions.at(focusedIndex) || focusedIndex === -1) && shouldBubble,

    and here

                shouldBubble: (!flattenedSections.allOptions.at(focusedIndex) || focusedIndex === -1) && shouldBubble,

    and pass the props shouldBubble={false} and shouldPreventDefault={false} here

                  <SelectionList
                    shouldBubble={false}
                    shouldPreventDefault={false}
                    ...

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

    N/a

    What alternative solutions did you explore? (Optional)

    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.

  4. daledah commented on Jul 8, 2025

    @daledah
    Contributor

    Proposal

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

    When searching for an user that doesn’t trigger any result on "From" filter on "Reports", an expense report is opened on the background while the "From" modal is still opened.

    What is the root cause of that problem?

    We subscribed enter key behavior in SearchList

    useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, selectFocusedOption, {
    captureOnInputs: true,
    shouldBubble: false,
    shouldPreventDefault: false,
    isActive: isFocused,
    shouldStopPropagation: true,
    });

    But when the UserSelectPopup popover is displayed, isFocused is still true

    => we can still trigger the enter behaviour.

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

    We can add condition focusedIndex >= 0 similar to here

        useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ENTER, selectFocusedOption, {
            captureOnInputs: true,
            shouldBubble: false,
            shouldPreventDefault: false,
            isActive: isFocused && focusedIndex >= 0,
            shouldStopPropagation: true,
        });
    

    isActive: !disableKeyboardShortcuts && !disableEnterShortcut && isFocused && focusedIndex >= 0,

    Or if the modal or popover is showing then we will set isActive to false by using onyxkey modal

        const [modal] = useOnyx(ONYXKEYS.MODAL, {canBeMissing: true});
        // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
        const isModalVisible = modal?.isVisible || modal?.willAlertModalBecomeVisible;
        ...
        isActive: isFocused && !isModalVisible,
    

    Note: We can also check if the modal is a popover or has type bottom_docked

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

    None

    What alternative solutions did you explore? (Optional)

    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.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 8, 2025
  6. changed the title [-]Reports - Searching a non existing user on "From", opens a report behind opened modal[/-] [+][$250] Reports - Searching a non existing user on "From", opens a report behind opened modal[/+] on Jul 8, 2025
  7. melvin-bot commented on Jul 8, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 8, 2025
  9. melvin-bot commented on Jul 8, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @dominictb (External)

  10. CortneyOfstad commented on Jul 8, 2025

    @CortneyOfstad
    Contributor

    Hey @dominictb! We have a couple of proposals (here and here) for you to review. Thanks!

  11. self-assigned this
    on Jul 8, 2025
  12. dangrous commented on Jul 8, 2025

    @dangrous
    Contributor

    Happy to help with internal review here when it's ready!

  13. 20 remaining items

  14. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 29, 2025
  15. melvin-bot commented on Jul 29, 2025

    @melvin-bot

    Triggered auto assignment to @johncschuster (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.

  16. CortneyOfstad commented on Jul 29, 2025

    @CortneyOfstad
    Contributor

    @dominictb can you please complete the checklist as soon as you can!

    Hey @johncschuster! Reassigned this as I will be OoO on Friday so there is not a delay in getting this paid. Payment summary found here. Thanks!

  17. dominictb commented on Jul 31, 2025

    @dominictb
    Contributor

    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: NA. This is just a minor edge case.

    • [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: NA

    • [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

    Precondition:

    • Have an expense

    Test:

    1. Go to Reports
    2. Open From filter
    3. Input something that would return no results
    4. Press Enter key
    5. Verify that expense report is NOT opened in the background

    Do we agree 👍 or 👎

  18. johncschuster commented on Jul 31, 2025

    @johncschuster
    Contributor

    Payment Summary

    Contributor: @daledah paid $250 via Upwork ✅
    Contributor+: @dominictb paid $250 via Upwork ✅

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