Skip to content

[Due for payment 2025-05-22] [Due for payment 2025-05-20] Workspace - Searching for member using full name returns no result #61650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
8 tasks done
jponikarchuk opened this issue May 8, 2025 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@jponikarchuk
Copy link

jponikarchuk commented May 8, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.1.42-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to check, new feature
If this was caught during regression testing, add the test name, ID and link from TestRail: #60488
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Have a workspace with at least 16 members.
  • At least one member has first and last name.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Members.
  3. Search for the member with first and last name using the full name.

Expected Result:

The search result will return the member with the full name.

Actual Result:

The search result returns nothing when searching for member using full name.

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

Issue OwnerCurrent Issue Owner: @strepanier03
@jponikarchuk jponikarchuk added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels May 8, 2025
Copy link

melvin-bot bot commented May 8, 2025

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

Copy link

melvin-bot bot commented May 8, 2025

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.

Copy link

melvin-bot bot commented May 8, 2025

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

@melvin-bot melvin-bot bot added the Daily KSv2 label May 8, 2025
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 8, 2025
Copy link
Contributor

github-actions bot commented May 8, 2025

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

@daledah
Copy link
Contributor

daledah commented May 8, 2025

Coming from #60488, I'll open a follow-up soon.

@nabi-ebrahimi
Copy link
Contributor

nabi-ebrahimi commented May 8, 2025

Proposal

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

When a user searches for a member using a full name or partial full name (e.g., "Jane D" or "zarin 3"), the member is not returned unless the search query exactly matches one of the fields (text or alternateText). This results in unexpected behavior, where valid partial name matches do not appear in the search results.

What is the root cause of that problem?

The filtering logic only checks if the search query is found within either text or alternateText separately. It also lacks proper normalization of the data, so partial matches like "zarin 3" do not match "zarin 30" even though the beginning of the name clearly aligns. In addition, queries that span both the first and last name (e.g., "Jane D") also fail, because the match isn’t performed on a combined and normalized name string.

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

Update the filterMember function to:

  const normalize = (value: string) => value.toLowerCase().replace(/\s+/g, ' ').trim();

    const filterMember = useCallback((memberOption: MemberOption, searchQuery: string) => {
        const fullText = normalize(`${memberOption.text ?? ''} ${memberOption.alternateText ?? ''}`);
        const normalizedQuery = normalize(searchQuery);
        return fullText.includes(normalizedQuery);
    }, []);
  • Concatenate both text and alternateText fields.

  • Normalize the combined string and the user input by:

    • Converting to lowercase
    • Replacing multiple spaces with a single space
    • Trimming surrounding spaces
      Then, check if the normalized query is included in the normalized combined string.

This approach ensures that partial and full-name queries like "Jane D", "zarin 3", or "Jane Sharifi" work reliably.

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)

Copy link
Contributor

github-actions bot commented May 8, 2025

⚠️ @nabi-ebrahimi Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

@cristipaval
Copy link
Contributor

Handing over to @roryabraham as I see he has more context on the big PR that introduced this regression.

@daledah
Copy link
Contributor

daledah commented May 8, 2025

Okay this one is tricky, BE send user's displayName that uses non-breaking space (ASCII code 160), while keyboard input uses space character (ASCII code 32) so they're not equal. @roryabraham What are your thoughts on this?

@daledah
Copy link
Contributor

daledah commented May 8, 2025

I've come up with a solution and added in #61686

Copy link

melvin-bot bot commented May 8, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@roryabraham
Copy link
Contributor

It looks like that PR contains maybe a few different fixes - but the core fix (stripping both spaces and nbsp from the search query and the strings to search) seems sound. Let's get that fix in review 👍🏼

Copy link

melvin-bot bot commented May 8, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented May 8, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@roryabraham
Copy link
Contributor

roryabraham commented May 8, 2025

Here's my fix: #61746

Definitely seems @daledah had the correct root cause, even if the implementation was slightly different.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels May 8, 2025
@kavimuru
Copy link

kavimuru commented May 8, 2025

Bug is not reproducible

Recording.3091.mp4

@roryabraham roryabraham removed the DeployBlockerCash This issue or pull request should block deployment label May 9, 2025
Copy link

melvin-bot bot commented May 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels May 9, 2025
Copy link

melvin-bot bot commented May 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented May 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 13, 2025
@melvin-bot melvin-bot bot changed the title Workspace - Searching for member using full name returns no result [Due for payment 2025-05-20] Workspace - Searching for member using full name returns no result May 13, 2025
Copy link

melvin-bot bot commented May 13, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 13, 2025
Copy link

melvin-bot bot commented May 13, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-05-20. 🎊

For reference, here are some details about the assignees on this issue:

  • @daledah requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented May 13, 2025

@roryabraham @strepanier03 @daledah The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels May 15, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-05-20] Workspace - Searching for member using full name returns no result [Due for payment 2025-05-22] [Due for payment 2025-05-20] Workspace - Searching for member using full name returns no result May 15, 2025
Copy link

melvin-bot bot commented May 15, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.45-21 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-05-22. 🎊

For reference, here are some details about the assignees on this issue:

  • @daledah requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented May 15, 2025

@roryabraham @strepanier03 @daledah The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants