Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.25-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/81167661/folder/13176908/145045748/1923344198?sort=-identifier
Email or phone of affected tester (no customers): lekima20+635010@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Win 11/Chrome
App Component: Search
Action Performed:
Precondition:
- User is an admin of a workspace connected to QBO with Export company card expenses as set to Credit card
- Go to the workspace chat create 2 non-reimbursable expenses: one with vendor "A B" and the other with vendor "Admin Denis"
- Open https://staging.new.expensify.com
- Navigate to Spend > Expenses
- Click the search icon at the top right and type "type:expense vendor:A B" > search
- Clear the search and type: "type:expense vendor A B" > search
- Clear the search and type: "type:expense vendor Admin Denis" > search
Expected Result:
Click the search icon at the top right and type type:expense vendor followed by the vendor name, verify the vendor name is highlighted like the other filter values. The search results match the filtered results
Actual Result:
Typing "type:expense vendor:A B" only the "A" is highlighted on the search box and displays no search result. Typing "type:expense vendor A B", the vendor name isn't highlighted, result displays both expenses with vendor "A B" and vendor "Admin Denis". Typing "type:expense vendor Admin Denis" displays no search result.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7299536_1793267750229.Recording__2645.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7299536
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022115775834824322193
- Upwork Job ID: 2115775834824322193
- Last Price Increase: 2026-10-29
Issue Owner
Current Issue Owner: @jasperhuanggMetadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Oct 29, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/d8eba1b8c483cf692fdae1f7eb9d1964794b7c8664a6436dad1b3942aa26e821
MelvinBot commentedon Oct 29, 2026
Proposal
What is the root cause of that problem?
This is mostly expected search syntax, plus one missing feature in the search box:
vendor:A B(step 3). An unquoted value ends at the first space. This is true for every filter, not onlyvendor(baseRules.peggy:221). The query becomesvendor:Aplus the keywordB, so only "A" is highlighted and nothing matches. Multi-word values must be quoted, for examplevendor:"A B". Merchant, category, and tag work the same way.vendor A Bandvendor Admin Denis(steps 4 and 5). Without a colon, these are plain keyword searches. The App sends the words to the server unchanged, and the server decides what matches. Nothing is highlighted because there is no filter.vendor:in the search box suggests no vendors. The suggestion switch handles tag and category, but has noVENDORcase (useAutocompleteSuggestions.ts:186-203). For other filters, picking a suggestion adds the quotes automatically (SearchRouter.tsx:476). For vendor, you have to type the quotes yourself, and the test step didn't include them.What changes do you think we should make in order to solve the problem?
VENDORcase touseAutocompleteSuggestions.ts. Fill it from the same synced vendor list that the Filters > Vendor picker uses. Selecting a vendor then insertsvendor:"A B"and highlights the full name.vendor:"<name>"for names that contain spaces.Steps 4 and 5 (keyword results) are decided by the server. If those results are wrong, an internal engineer needs to look at them.
What alternative solutions did you explore? (Optional)
Let
vendor:accept unquoted values that contain spaces. I rejected this because it would break the rule every other filter follows. It would also makevendor:A Bambiguous with a following keyword.Supporting evidence
baseRules.peggy:231-238.SearchAutocompleteUtils.ts:309-313.vendor:"Acme Tools":SearchAutocompleteUtilsTest.ts:228-235.SearchQueryUtils.ts:2016-2019.Possibly related: [$175] Filters - Vendor option is missing in filters
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/105375)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Oct 29, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)[-]Search-"type:expense vendor name", vendor name not highlighted and search result not correct[/-][+][$175] Search-"type:expense vendor name", vendor name not highlighted and search result not correct[/+]melvin-bot commentedon Oct 29, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022115775834824322193
camesenin commentedon Oct 29, 2026
melvin-bot commentedon Oct 29, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
khizzcr7 commentedon Oct 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Searching
type:expense vendor:A Bhighlights only "A" and returns nothing, and colonless searches liketype:expense vendor Admin Denishighlight nothing and return wrong results. The tester expects the vendor name to be highlighted like other filter values and the results to match the filtered expenses.What is the root cause of that problem?
Two distinct behaviors, one of which is a genuine App gap:
vendor:A Bparses as vendorAplus keywordB, so only "A" is highlighted and nothing matches both conditions. Multi-word vendor values must be quoted, e.g.vendor:"A B". Without a colon,vendor A Bandvendor Admin Denisare plain keyword searches, so nothing is highlighted and the server decides what matches.vendor:suggests no vendors. Verified against main source: the switch insrc/hooks/useAutocompleteSuggestions.tscovers TAG, CATEGORY, CURRENCY, TAX_RATE and user filters, but has no vendor case. So a user can never discover the correct quoted form from the search box, which is exactly why the tester typed the unquoted forms.What changes do you think we should make in order to solve the problem?
Add a vendor case to
useAutocompleteSuggestions.ts, mirroring the existing TAG/CATEGORY cases:alreadyAutocompletedKeysdedup the TAG case uses).sanitizeSearchValueinsrc/libs/SearchQueryUtils.tsalready wraps any value containing a space in quotes, so selecting "A B" insertsvendor:"A B", which parses as a single vendor value and highlights in full.What alternative solutions did you explore?
vendor:A Bambiguous with a vendor filter plus a keyword, and would change behavior for every filter.vendor: rejected, it would reinterpret legitimate keyword searches.What automated tests can you add to prevent this from re-occurring?
vendor:with a synced vendor list returns matching vendors; with no synced list returns an empty list.vendor:"A B"and reparsing yields exactly one vendor valueA B, with neighbouring filters intact.vendor:A Bstill parses as vendorAplus keywordB(documented behaviour, unchanged).sonofkratos92 commentedon Oct 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When searching in
Spend > Expensesfor expenses with multi-word vendor names like"A B"or"Admin Denis":type:expense vendor:A Bonly highlightsAin the search input, shows no vendor autocomplete suggestions to select"A B", and returns no results (becauseAis parsed as the vendor filter value andBis parsed as a separate free-text keyword).type:expense vendor A Bortype:expense vendor Admin Deniswithout a colon runs a plain keyword search rather than avendor:filter.What is the root cause of that problem?
src/libs/SearchParser/baseRules.peggy:221), unquoted filter values terminate at whitespace, so multi-word filter values must be quoted (vendor:"A B"). When a user typesvendor:Aand then presses space followed byB(type:expense vendor:A B),defaultFilterinsrc/libs/SearchParser/autocompleteParser.peggy:39-75parsesvendor:AintorangesandfreeTextFilter(autocompleteParser.peggy:83) parsesBand resetsautocomplete = null.src/hooks/useAutocompleteSuggestions.tshas nocase CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR:branch, so typingvendor:never suggests synced workspace vendors (unlikecategory:,tag:, orexported-to:), which is what normally wraps multi-word values in quotes viasanitizeSearchValueinsrc/components/Search/SearchRouter/SearchRouter.tsx:480.VENDORcase is added touseAutocompleteSuggestions.tsalone,CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDORis also missing fromCONTINUATION_DETECTION_SEARCH_FILTER_KEYSinsrc/libs/SearchAutocompleteUtils.ts:683-691. WithoutVENDORinCONTINUATION_DETECTION_SEARCH_FILTER_KEYS(andmapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDORon each suggestion item):type:expense vendor:A Bortype:expense vendor:Admin Denis),parseForAutocompletereturnsautocomplete: null. BecauseuseAutocompleteSuggestions.ts:157-168only checksCONTINUATION_DETECTION_SEARCH_FILTER_KEYSwhen!autocomplete, the vendor suggestions disappear immediately after the space is typed.getTrimmedUserSearchQueryPreservingComma(src/libs/SearchAutocompleteUtils.ts:1045-1071) only trims back tovendor:(or the last comma) whenfieldKeyis inCONTINUATION_DETECTION_SEARCH_FILTER_KEYS; otherwise it falls back togetQueryWithoutAutocompletedPart(textInputValue), which returns the untrimmed string whenparsedQuery.autocompleteisnulland producestype:expense vendor:A B"A B".What changes do you think we should make in order to solve the problem?
src/libs/SearchAutocompleteUtils.ts, addCONST.SEARCH.SYNTAX_FILTER_KEYS.VENDORtoCONTINUATION_DETECTION_SEARCH_FILTER_KEYS:src/hooks/useAutocompleteSuggestions.ts, importusePermissionsfrom./usePermissionsandgetMatchingVendors, getVendorFeaturePolicyIDsfrom@libs/PolicyUtils, checkconst isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING);, and add theVENDORcase toswitch (autocompleteKey)using the same synced vendor source asVendorSelector.tsxwithmapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.VENDOR:With both changes in place, typing
type:expense vendor:A Bortype:expense vendor:Admin Deniskeeps the matching vendor suggestion visible across spaces, and selecting it replaces the unquoted text aftervendor:withvendor:"A B"(orvendor:"Admin Denis"), highlighting the full vendor name and returning the matching expense.What alternative solutions did you explore? (Optional)
Changing the Peggy parser to allow unquoted spaces inside
vendor:values would makevendor:A Bambiguous with trailing search keywords and break consistency with other filters (merchant:,category:,tag:). AddingVENDORtouseAutocompleteSuggestionstogether withCONTINUATION_DETECTION_SEARCH_FILTER_KEYSpreserves the standard quoted syntax while supporting multi-word vendor autocomplete when typing spaces.apoorv-xs commentedon Oct 29, 2026
melvin-bot commentedon Oct 29, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
ikevin127 commentedon Oct 29, 2026
Proposals review
Only MelvinBot's proposal counts here, since this issue never had the
Help Wantedlabel.Not a bug
I tested this with a QBO workspace (company card expenses exported as Credit card) and non-reimbursable expenses with synced vendors
A AandFive Stars. Everything matches MelvinBot's root cause:type:expense vendor:A A: only the firstAis highlighted and nothing is returned.type:expense vendor:"A A": the full name is highlighted and the matching expense is returned.type:expense vendor:Five Stars: onlyFiveis highlighted and nothing is returned.type:expense vendor:"Five Stars": the full name is highlighted and the matching expense is returned.A value without quotes ends at the first space (
baseRules.peggy:221), sovendor:Five Starssearchesvendor:Fiveplus the keywordStars. The same is true for every free-text filter (merchant:,description:). Multi-word values need quotes.The issue's colonless searches (
vendor A B,vendor Admin Denis) aren't vendor filters at all. They're keyword searches, so nothing is highlighted and the server decides what matches. The test steps come from Tests step 6 of #104351 (type:expense vendor:<name>), which didn't say that multi-word names need quotes.Recommendation
Close this as not a bug, and update the regression test case to quote multi-word vendor names, e.g.
type:expense vendor:"A B".MelvinBot's
vendor:autocomplete idea would help users find the right syntax, but it's a new feature rather than a fix (merchant:has no autocomplete either). Up to you whether to track it separately.🎀👀🎀 C+ reviewed
melvin-bot commentedon Oct 29, 2026
Triggered auto assignment to @jasperhuangg, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
jasperhuangg commentedon Nov 2, 2026
Created a QA request to update the vendor-search regression test to quote multi-word names. The request links the reported run and the existing vendor-search case, and asks Applause to confirm the affected case and validate the updated steps.