You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-10-28] [$250] Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office" #72615
Version Number: v9.2.31-0 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://github.com/Expensify/Expensify/issues/514326 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team
Action Performed:
Precondition: have "Employee Meals Office" category in WS.
Navigate to the category picker.
Enter "Employee Office" in the search bar.
Observe the search results.
Expected Result:
The category "Employee Meals Office" should appear in the search results when "Employee Office" is searched, as it is a related term.
Actual Result:
The category "Employee Meals Office" does not appear in the search results
What changes do you think we should make in order to solve the problem?
We should update this function to
const filterCategory = useCallback((categoryOption: PolicyOption, searchInput: string) => {
const categoryText = StringUtils.normalize(categoryOption.text?.toLowerCase() ?? '');
const alternateText = StringUtils.normalize(categoryOption.alternateText?.toLowerCase() ?? '');
const normalizedSearchInput = StringUtils.normalize(searchInput.toLowerCase());
// Split search input into tokens (words)
const searchTokens = normalizedSearchInput.split(CONST.REGEX.WHITESPACE).filter(Boolean);
// If no search tokens, show all items
if (searchTokens.length === 0) {
return true;
}
// Get all text tokens from category text and alternate text
const categoryTokens: string[] = [];
for (const text of [categoryText, alternateText]) {
if (text) {
const tokens = text.split(CONST.REGEX.WHITESPACE).filter(Boolean);
categoryTokens.push(...tokens);
}
}
// Check if all search tokens are found in category tokens
// Each search token should be a substring of at least one category token
return searchTokens.every((searchToken) => categoryTokens.some((categoryToken) => categoryToken.includes(searchToken)));
}, []);
Note: we can create utils function for logic above and we should update other pages that have the same problem as well
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)
NA
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.
changed the title [-]Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office"[/-][+][$250] Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office"[/+]on Oct 14, 2025
Please re-state the problem that we are trying to solve in this issue.
Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office"
What is the root cause of that problem?
filterCategory function uses a simple substring match with includes to filter categories, which requires the entire search phrase to appear as a continuous substring in the category name
Other parts of the codebase use tokenizedSearch for search purposes. For example, CategoryOptionListUtils.ts uses tokenizedSearch, which properly handles multi-word searches by checking if each search token appears anywhere in the target text
⚠️@nyomanjyotisa 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).
@dukenv0307@JmillsExpensify 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]
[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: N/A
[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.
Regression Test Proposal Template
[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 "Employee Meals Office" category in WS.
There are more than 15 entries on the Members, Tags, Taxes, Distance Rates, and Per Diem pages.
Test:
Navigate to the category picker.
Enter "Employee Office" in the search bar (or first word and last word for another page).
Observe the search results.
Verify that the "Employee Meals Office" category appears in the search results when "Employee Office" is searched.
Repeat the same steps for Members, Tags, Taxes, Distance Rates, and Per Diem (search for entries using the first and last words).
Activity
melvin-bot commentedon Oct 14, 2025
Triggered auto assignment to @JmillsExpensify (
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.daledah commentedon Oct 14, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The category "Employee Meals Office" does not appear in the search results
What is the root cause of that problem?
We are using the
includesmethod to filter hereApp/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Lines 202 to 207 in 362571e
What changes do you think we should make in order to solve the problem?
We should update this function to
Note: we can create utils function for logic above and we should update other pages that have the same problem as well
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)
NA
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.
[-]Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office"[/-][+][$250] Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office"[/+]melvin-bot commentedon Oct 14, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021978203051148613358
melvin-bot commentedon Oct 14, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)JmillsExpensify commentedon Oct 14, 2025
I would be surprised if this isn't BE though opening for proposals to see where we land.
nyomanjyotisa commentedon Oct 14, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - Category Picker - "Employee Office" Does Not Return "Employee Meals Office"
What is the root cause of that problem?
filterCategoryfunction uses a simple substring match withincludesto filter categories, which requires the entire search phrase to appear as a continuous substring in the category nameApp/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Lines 202 to 207 in af76aaf
Other parts of the codebase use
tokenizedSearchfor search purposes. For example,CategoryOptionListUtils.tsusestokenizedSearch, which properly handles multi-word searches by checking if each search token appears anywhere in the target textApp/src/libs/CategoryOptionListUtils.ts
Line 133 in af76aaf
What changes do you think we should make in order to solve the problem?
We should replace the simple substring matching with the existing
tokenizedSearchfunctionOr if we want to normalize the search input
App/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Lines 202 to 207 in af76aaf
We should also check and update the other page with the same issue
What alternative solutions did you explore? (Optional)
None
github-actions commentedon Oct 14, 2025
19 remaining items
melvin-bot commentedon Oct 21, 2025
@dukenv0307 @JmillsExpensify 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]
dukenv0307 commentedon Oct 23, 2025
BugZero Checklist:
[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: https://github.com/Expensify/App/pull/61746/files#r2454418466
[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: N/A
[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.
Regression Test Proposal Template
[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 "Employee Meals Office" category in WS.
There are more than 15 entries on the Members, Tags, Taxes, Distance Rates, and Per Diem pages.
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Oct 28, 2025
Payment Summary
Upwork Job
BugZero Checklist (@JmillsExpensify)
melvin-bot commentedon Oct 31, 2025
@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
JmillsExpensify commentedon Nov 4, 2025
Payment summary:
JmillsExpensify commentedon Nov 4, 2025
Offer sent to contributor. @dukenv0307 please suggest regression test when you get a chance.
dukenv0307 commentedon Nov 6, 2025
@JmillsExpensify I completed here
JmillsExpensify commentedon Nov 6, 2025
Nice, Upwork paid out so I'm closing this issue.
garrettmknight commentedon Nov 11, 2025
$250 approved for @dukenv0307