Skip to content

[$250] Rule - Empty user names are displayed when searched in attendee field in an expense detail #79627

Closed

Description

@mitarachim

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: v9.3.2-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2966/folder/13176708/41236908/1125946493?sort=%2Bidentifier
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11/ Chrome
App Component: Workspace Settings

Action Performed:

Pre-requisite:
User has a control workspace with an employee
Control workspace has Rules enable in More features
Workspace has attendee tracking enabled in Rules

Steps:

  1. Sign in to staging.new.expensify.com with an account that fulfils the pre-requisite
  2. Navigate to workspace chat
  3. Create an expense with an attendee set in the expense preview
  4. Navigate to the expense created in step 3
  5. Click on "Attendee" field in the expense details
  6. Search for the employee user name (make sure to type the full name to search for the employee)
  7. Clear the search field
  8. Search for random characters (eg. x, y, z, ... anything that is not used as a username for an employee in the workspace)

Expected Result:

No results found is displayed

Actual Result:

an empty account with the searched character as a username is displayed even though the account is not a member of the workspace

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7049495_1768432488135.bandicam_2026-01-15_01-55-26-149.mp4

View all open jobs on GitHub

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 15, 2026
  2. melvin-bot commented on Jan 15, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (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. dmkt9 commented on Jan 15, 2026

    @dmkt9
    Contributor

    Proposal

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

    an empty account with the searched character as a username is displayed even though the account is not a member of the workspace

    What is the root cause of that problem?

    We currently allow inviting users with includeUserToInvite: true here.

    At the same time, we do not filter out users who are not members of the policy.

    const orderedOptions = orderOptions(
    {
    recentReports: availableOptions.recentReports,
    personalDetails: availableOptions.personalDetails,
    workspaceChats: availableOptions.workspaceChats ?? [],
    },

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

    Test branch

    1. Set includeUserToInvite to false.
        includeUserToInvite: false,
    
    1. Filter to only include users who are members of the policy.
      personalDetails: availableOptions.personalDetails,
        personalDetails: availableOptions.personalDetails.filter((person) => !policy?.employeeList || !person.login || person.login in policy.employeeList),
    

    const recentAttendeeLists = useMemo(() => getFilteredRecentAttendees(personalDetails, attendees, recentAttendees ?? []), [personalDetails, attendees, recentAttendees]);

    const recentAttendeeLists = useMemo(
        () => getFilteredRecentAttendees(personalDetails, attendees, recentAttendees ?? [], policy?.employeeList),
        [personalDetails, attendees, recentAttendees, policy?.employeeList],
    );
    

    function getFilteredRecentAttendees(personalDetails: OnyxEntry<PersonalDetailsList>, attendees: Attendee[], recentAttendees: Attendee[]): Option[] {

    function getFilteredRecentAttendees(personalDetails: OnyxEntry<PersonalDetailsList>, attendees: Attendee[], recentAttendees: Attendee[], policyEmployeeList?: PolicyEmployeeList): Option[] {
    

    .filter((attendee) => !attendees.find(({email, displayName}) => (attendee.email ? email === attendee.email : displayName === attendee.displayName)))

        .filter(
            (attendee) =>
                !attendees.find(({email, displayName}) => (attendee.email ? email === attendee.email : displayName === attendee.displayName)) &&
                (!policyEmployeeList || !attendee.email || (attendee.login ?? attendee.email) in policyEmployeeList),
        )
    

    What alternative solutions did you explore? (Optional)

    N/A

  4. nkdengineer commented on Jan 15, 2026

    @nkdengineer
    Contributor

    It's expected here

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 16, 2026
  6. changed the title [-]Rule - Empty user names are displayed when searched in attendee field in an expense detail[/-] [+][$250] Rule - Empty user names are displayed when searched in attendee field in an expense detail[/+] on Jan 16, 2026
  7. melvin-bot commented on Jan 16, 2026

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

    @melvin-bot

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

  10. brianlee-expensify commented on Jan 16, 2026

    @brianlee-expensify
    Contributor

    @mallenexpensify seems like this is expected behavior (see comment)

    @jayeshmangwani to confirm

  11. melvin-bot commented on Jan 21, 2026

    @melvin-bot

    @jayeshmangwani Huh... This is 4 days overdue. Who can take care of this?

  12. jayeshmangwani commented on Jan 22, 2026

    @jayeshmangwani
    Contributor

    Yes, It seems this is the expected behavior on this PR #79111.

    @trjExpensify @lakchote , could you please confirm that this behavior (an empty account with the searched character as a username is displayed even though the account is not a member of the workspace) is expected? If so, we can go ahead and close this issue.

  13. self-assigned this
    on Jan 23, 2026
  14. lakchote commented on Jan 23, 2026

    @lakchote
    Contributor

    This is expected as we allow external attendees with names cc @trjExpensify

    Closing the issue.

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions