[$175] Merchant list displays escape characters
The merchant list displays literal backslashes before special characters. Examples from the screenshot include Asknicely\* Ask Nicely, Dnh\*godaddy.com, and Google\*cloud.
Expected: Display merchant names without formatting escape characters, while preserving the special characters themselves.
Actual: Escape backslashes are visible in the Merchant column.
Reported with a screenshot in Slack. The original screenshot is available in the linked thread.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022119889882405572392
- Upwork Job ID: 2119889882405572392
- Last Price Increase: 2026-11-09
Issue Owner
Current Issue Owner: @shubham1206agra
Triggered auto assignment to Contributor-plus team member for initial proposal review - @FitseTLT (External)
Job added to Upwork: https://www.upwork.com/jobs/~022119889882405572392
Proposal
What is the root cause of that problem?
Merchant names stored in transaction objects or indexed by the search backend have markdown-sensitive characters (such as *, _, ~, \, [, ]) escaped with backslashes to avoid markdown collisions when referenced in chat reports.
However, when formatted for plain-text UI displays (Search table columns, grouped list headers, and transaction previews), the raw merchant string is consumed without unescaping markdown escape characters:
- In
src/libs/SearchUIUtils.ts:940–941insidegetTransactionItemCommonFormattedProperties:const merchant = getTransactionMerchant(transactionItem); const formattedMerchant = isInvalidMerchantValue(merchant) ? '' : merchant;merchantcontains the raw escaped string and is assigned directly toformattedMerchant. - In
src/libs/SearchUIUtils.ts:3690insidegetMerchantGroupSections:const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : rawMerchant;rawMerchantcontains the raw escaped string for the section header. - In
src/libs/TransactionUtils/index.ts:1680–1695insidegetMerchantName:
Consumesconst merchantName = StringUtils.getFirstLine(merchant);merchantdirectly without unescaping.
What changes do you think we should make in order to solve the problem?
-
Add
unescapeutility insrc/libs/StringUtils/index.ts(orsrc/libs/StringUtils/unescape.ts):/** * Removes markdown escape backslashes preceding markdown-sensitive characters. */ function unescape(str: string): string { if (!str) { return ''; } return str.replaceAll(/\\([*_\\\[\]()~`>#+=|{}.!-])/g, '$1'); } -
In
src/libs/SearchUIUtils.ts:- At line 941 (in
getTransactionItemCommonFormattedProperties):const formattedMerchant = isInvalidMerchantValue(merchant) ? '' : StringUtils.unescape(merchant); - At line 3690 (in
getMerchantGroupSections):const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : StringUtils.unescape(rawMerchant);
- At line 941 (in
-
In
src/libs/TransactionUtils/index.tsinsidegetMerchantName:const cleanMerchant = StringUtils.unescape(merchant); const merchantName = StringUtils.getFirstLine(cleanMerchant); -
Add unit test coverage:
- In
tests/unit/StringUtilsTest.ts: Verify thatStringUtils.unescapeproperly strips escape backslashes:'Asknicely\\* Ask Nicely'->'Asknicely* Ask Nicely''Dnh\\*godaddy.com'->'Dnh*godaddy.com''Google\\*cloud'->'Google*cloud''Store\\_1'->'Store_1'- Handles empty strings and normal strings without modifications.
- In
tests/unit/TransactionUtilsTest.ts: Add a test case indescribe('getMerchantName')verifying that transactions with escaped characters return clean unescaped merchant names. - In
tests/unit/SearchUIUtilsTest.ts: Verify thatgetTransactionItemCommonFormattedPropertiesreturns unescapedformattedMerchant.
- In
What alternative solutions did you explore? (Optional)
- Unescaping only in
TransactionUtils.getMerchantName: Rejected because Search table columns and Group-by-Merchant headers constructformattedMerchantdirectly viaSearchUIUtils.ts. Updating bothSearchUIUtilsandTransactionUtilsguarantees uniform display everywhere.
Tests
- Navigate to Search > Expenses.
- Group by Merchant or view the Merchant table column for transactions containing special characters (e.g.,
*,_). - Verify that the merchant name renders cleanly without visible backslashes (e.g.
Asknicely* Ask Nicely,Dnh*godaddy.com,Google*cloud). - Run unit tests:
npm test tests/unit/StringUtilsTest.ts tests/unit/TransactionUtilsTest.ts tests/unit/SearchUIUtilsTest.ts
- Contributor: @kevinjosh10
- Expensify Account Email: [email protected]
- Upwork Profile: https://www.upwork.com/freelancers/~0131dae36abcf59374
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
Merchant names in the merchant list show literal backslashes before special characters, e.g. Asknicely\* Ask Nicely, Dnh\*godaddy.com, Google\*cloud. The names should display without the escape characters while keeping the special characters themselves.
What is the root cause of that problem?
Merchant strings arrive with markdown-style escapes (\*) and are rendered raw: MerchantOrDescriptionCell in src/components/TransactionItemRow/DataCells/MerchantCell.tsx displays merchantOrDescription as-is, with no unescaping (descriptions in the same cell go through Parser.htmlToText, merchants do not), so the escaping backslash reaches the screen.
What changes do you think we should make in order to solve the problem?
Unescape backslash-escaped special characters at the merchant display layer — strip the escaping \ while keeping the character (Asknicely\* Ask Nicely → Asknicely* Ask Nicely). Apply it where the merchant name is rendered so every list surface benefits, and check whether the same escaped value feeds the search merchant filter and merchant rules so those are covered if they share the path. During implementation I will confirm whether the escaping originates server-side (stored value) or App-side, and place the unescape at the narrowest shared display point accordingly.
What alternative solutions did you explore? (Optional)
Stripping the backslashes at ingestion was considered, but display-layer unescaping is safer: it does not change stored values or matching behaviour, and it fixes every surface that renders the name.
How will you verify the fix?
Verify against the reported cases (Asknicely\* Ask Nicely, Dnh\*godaddy.com, Google\*cloud) in the merchant list, and confirm merchant names without escapes render unchanged. Add a unit test for the unescape helper covering escaped * and other special characters plus plain names.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01c5c6bc0e7d162f7b
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
What is the root cause of that problem?
The "merchant list" is the Search group-by-Merchant view. getMerchantGroupSections in src/libs/SearchUIUtils.ts:3683 sets formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : rawMerchant, where rawMerchant is merchantGroup.merchant, the group key from the search backend. That key is query-escaped (Google\*cloud) because the same value is passed unchanged to buildSpecificGroupQuery(..., SYNTAX_FILTER_KEYS.MERCHANT, merchantGroup.merchant) a few lines above (about line 3670) to build the drill-down query. MerchantListItemHeader.tsx:28 then renders merchantItem.formattedMerchant ?? merchantItem.merchant as-is, so the escaping backslash reaches the screen. I read both files; I could not read the backend, so that the group key arrives escaped is inferred from the screenshot text in the issue.
What changes do you think we should make in order to solve the problem?
In getMerchantGroupSections only, display-unescape: rawMerchant.replace(/\\(.)/g, '$1') for formattedMerchant, and leave merchantGroup.merchant untouched so buildSpecificGroupQuery still receives the escaped key and the drill-down keeps matching. Sorting uses formattedMerchant (SearchUIUtils.ts:457), so it sorts on the clean name.
Test (tests/unit/SearchUIUtilsTest.ts): feed a merchant group with merchant: 'Google\\*cloud'; assert formattedMerchant === 'Google*cloud' and transactionsQueryJSON still contains the escaped value. A plain name must be unchanged.
What alternative solutions did you explore? (Optional)
kevinjosh10 changes getMerchantName in TransactionUtils (the per-transaction row, not this group list) and calls Parser.unescape, which is markdown unescaping and not the search-query escape. khizzcr7 patches MerchantCell.tsx, which receives the transaction merchant, not the group header. Mine fixes the one place the escaped group key becomes display text, and keeps the query value raw.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Merchant names containing special characters such as * (e.g. Asknicely\* Ask Nicely, Dnh\*godaddy.com, Google\*cloud) display literal escape backslashes (\*) in the Merchant column instead of the clean merchant name (Asknicely* Ask Nicely, Dnh*godaddy.com, Google*cloud).
What is the root cause of that problem?
Card transaction merchant descriptors containing markdown-sensitive characters (*, _, ~) arrive from the backend with markdown escape backslashes (e.g. Google\*cloud). In src/libs/SearchUIUtils.ts, those raw strings are assigned directly to formattedMerchant without unescaping:
- Group-by-Merchant view (
group-by:merchant/ Top Merchants): Insrc/libs/SearchUIUtils.ts(getMerchantSections(), lines 3657–3698),rawMerchant = merchantGroup.merchantis assigned directly toformattedMerchantat line 3683:const rawMerchant = merchantGroup.merchant; const isEmptyMerchant = !rawMerchant || rawMerchant === CONST.SEARCH.MERCHANT_EMPTY_VALUE || rawMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT || isInvalidMerchantValue(rawMerchant); const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : rawMerchant;src/components/Search/SearchList/ListItem/MerchantListItemHeader.tsx(line 28) then passesmerchantItem.formattedMerchant ?? merchantItem.merchant ?? ''directly toBaseListItemHeader(CONST.SEARCH.TABLE_COLUMNS.GROUP_MERCHANT),src/libs/getSearchColumnContentToMeasure.ts(line 192) measuresitem.formattedMerchant, andsrc/pages/Insights/charts/InsightsDataTable.tsxdisplaysitem.formattedMerchantas-is. - Expense rows (
CONST.SEARCH.TABLE_COLUMNS.MERCHANT): Insrc/libs/SearchUIUtils.ts(getTransactionItemCommonFormattedProperties(), lines 933–934),const merchant = getTransactionMerchant(transactionItem); const formattedMerchant = isInvalidMerchantValue(merchant) ? '' : merchant;also preserves the literal\escape characters, which are then returned bygetMerchantName()insrc/libs/TransactionUtils/index.ts(lines 723–734) and rendered insrc/components/TransactionItemRow/DataCells/MerchantCell.tsx(line 34, where!isDescriptionbypassesParser.htmlToText).
What changes do you think we should make in order to solve the problem?
- Add a helper
unescapeMerchantName(merchant: string): stringinsrc/libs/TransactionUtils/index.tsthat strips markdown/escape backslashes preceding punctuation (merchant.replace(/\\([*_~[]()#+-.!])/g, '$1')ormerchant.replace(/\(.)/g, '$1')`):function unescapeMerchantName(merchant: string): string { return merchant.replace(/\\(.)/g, '$1'); } - Apply
unescapeMerchantNameto display-facing merchant values while preserving the raw merchant key for search drill-down queries:- In
src/libs/SearchUIUtils.ts(getMerchantSections(), lines 3668–3684): keepmerchantGroup.merchantunchanged inbuildSpecificGroupQuery(queryJSON, CONST.SEARCH.SYNTAX_FILTER_KEYS.MERCHANT, ...)at line 3670 so expanding/drilling into a merchant group still queries the exact backend key, and unescapeformattedMerchantat line 3683:const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : unescapeMerchantName(rawMerchant); - In
src/libs/SearchUIUtils.ts(getTransactionItemCommonFormattedProperties(), line 934) andsrc/libs/TransactionUtils/index.ts(getMerchantName(), line 732): unescape the display merchant string so both the grouped Merchant list (MerchantListItemHeader), Insights Top Merchants table (InsightsDataTable), and the Expense table Merchant column (MerchantCell) renderAsknicely* Ask Nicely,Dnh*godaddy.com, andGoogle*cloudconsistently, and alphabetical sorting onformattedMerchant(transactionMerchantGroupColumnNamesToSortingPropertyatsrc/libs/SearchUIUtils.ts:457) sorts by the unescaped display text.
- In
- Add unit tests in
tests/ui/MerchantListItemHeaderTest.tsxandtests/unit/Search/SearchUIUtilsTest.tscovering escaped merchant strings (Asknicely\* Ask Nicely,Dnh\*godaddy.com,Google\*cloud).
What alternative solutions did you explore? (Optional)
- Unescaping only in
MerchantCell.tsxor only ingetMerchantName(): MissesgetMerchantSections()insrc/libs/SearchUIUtils.ts:3683, whereMerchantListItemHeader.tsxreadsmerchantItem.formattedMerchantdirectly without callinggetMerchantNameor renderingMerchantCell. - Unescaping
merchantGroup.merchantbeforebuildSpecificGroupQuery()(src/libs/SearchUIUtils.ts:3670): Would alter the filter value sent to the search query when drilling into a merchant group if the backend indexes the escaped string; keepingmerchantGroup.merchantforbuildSpecificGroupQueryand unescapingformattedMerchantisolates the change to display and sorting.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Search tables and grouped merchant views, merchant names that contain special characters (such as *, _, \) display literal escape backslashes in the Merchant column (e.g. Asknicely\* Ask Nicely, Dnh\*godaddy.com, Google\*cloud) instead of clean unescaped merchant names (Asknicely* Ask Nicely, Dnh*godaddy.com, Google*cloud).
What is the root cause of that problem?
In src/libs/SearchUIUtils.ts:
-
In
getMerchantGroupSections(around line 3679):const rawMerchant = merchantGroup.merchant; const isEmptyMerchant = !rawMerchant || rawMerchant === CONST.SEARCH.MERCHANT_EMPTY_VALUE || rawMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT || isInvalidMerchantValue(rawMerchant); const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : rawMerchant;The backend returns
merchantGroup.merchantescaped for search query filter syntax (e.g.Google\*cloud) so it can be passed safely tobuildSpecificGroupQuery(..., SYNTAX_FILTER_KEYS.MERCHANT, merchantGroup.merchant). However,formattedMerchantis assignedrawMerchantwithout stripping the query escape backslashes before rendering. -
Similarly, in individual transaction formatting within
getSearchFormattedProperties(around line 932-933):const merchant = getTransactionMerchant(transactionItem); const formattedMerchant = isInvalidMerchantValue(merchant) ? '' : merchant;When transaction merchant strings from search results contain backend query-escaped characters,
formattedMerchantpreserves the raw escape backslashes into the UI table cells.
What changes do you think we should make in order to solve the problem?
- In
src/libs/SearchUIUtils.ts:-
Introduce a helper or use an unescape utility to clean display merchant names:
function unescapeSearchMerchant(merchant: string): string { return merchant.replaceAll(/\\([*_\\])/g, '$1'); } -
In
getMerchantGroupSections:const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : unescapeSearchMerchant(rawMerchant);This keeps
merchantGroup.merchantintact for drill-down search queries (buildSpecificGroupQuery), while ensuring the UIformattedMerchantdisplays the clean name without backslashes. -
In
getSearchFormattedProperties: SanitizeformattedMerchantwhen constructing transaction list items:const formattedMerchant = isInvalidMerchantValue(merchant) ? '' : unescapeSearchMerchant(merchant);
-
What alternative solutions did you explore? (Optional)
Unescaping at the component level in MerchantListItemHeader or table cell renderers, but unescaping during the section/row formatting pipeline in SearchUIUtils.ts ensures consistent sorting, search section headers, and table cell rendering across all platforms.
Tests
- Navigate to the Search page (
/search). - Search for transactions or group by Merchant with transactions whose merchant names contain asterisks, backslashes, or special characters (e.g.
Asknicely* Ask Nicely,Google*cloud). - Verify that the Merchant column and grouped merchant section headers display clean names without literal backslashes (
Asknicely* Ask Nicely). - Click on the grouped merchant section to drill down and verify the query executes properly without filter syntax errors.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01ca8ad8ce36b9eceb
:warning: Unable to store contributor details
Details
Auth SetContributorDetails returned an error 401 Contributor details already exist
Proposal
Please re-state the problem that we are trying to solve in this issue.
The merchant list displays unescaped characters or raw HTML/URL escape sequences (such as & or %20) instead of decoded, user-readable strings.
What is the root cause of that problem?
In src/components/SelectionList/TableListItem.tsx or merchant name formatting in MoneyRequestMerchantPage.tsx / TransactionUtils.ts:
Merchant strings returned from backend search or recent transactions are not passed through HTML entity decoding / URI decoding before being rendered in the text item component, causing literal & or %20 entities to be shown directly in the UI.
What changes do you think we should make in order to solve the problem?
- In
src/libs/StringUtils.ts:- Ensure an HTML entity decoder (or
decodeHTMLEntities) is available for sanitized display strings.
- Ensure an HTML entity decoder (or
- In
src/pages/iou/request/step/IOURequestStepMerchant.tsxand merchant list items:- Sanitize and decode merchant display names before feeding them into the option list item labels.
What alternative solutions did you explore? (Optional)
Decoding at the input submission level only, which would not fix existing historical merchants already stored in Onyx.
@FitseTLT Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing merchants imported from card descriptors that contain markdown punctuation such as * (for example ASKNICELY* ASK NICELY, DNH*GODADDY.COM, GOOGLE*CLOUD, GOOGLE*WORKSPACE), Reports > Spend (grouped by Merchant, as well as transaction rows and Insights > Top Merchants) displays raw backslash escape sequences like Asknicely\* Ask Nicely, Dnh\*godaddy.com, and Google\*cloud instead of Asknicely* Ask Nicely, Dnh*godaddy.com, and Google*cloud.
What is the root cause of that problem?
-
Why
\*exists in backend merchant data (Markdown escaping, not search-query escaping):- Card processor descriptors frequently include
*(e.g.GOOGLE*CLOUD,DNH*GODADDY.COM),_, or~. When imported/sanitized on the backend, markdown-triggering punctuation is backslash-escaped (\*,\_,\~) soExpensiMark(expensify-common/lib/ExpensiMark.ts:1446-1464,1518-1532) does not interpret pairs of*,_, or~across system messages / HTML comments as<strong>,<em>, or<del>. - Note: this is not frontend search-query escaping—
src/libs/SearchQueryUtils.ts:289-295(sanitizeSearchValue) only escapes[\\"“”], never*.
- Card processor descriptors frequently include
-
All plain-text merchant display paths render the escaped string verbatim without unescaping markdown punctuation:
- Merchant group rows (
Reports > Spend > Group by: Merchant) &Insights > Top Merchantslabels: Insrc/libs/SearchUIUtils.ts:3748-3759(getMerchantSections),formattedMerchantis assigned rawmerchantGroup.merchant:
Thatconst rawMerchant = merchantGroup.merchant; ... const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : rawMerchant;formattedMerchantis rendered directly as plain<Text>insrc/components/Search/SearchList/ListItem/MerchantListItemHeader.tsx:28and in Insights > Top Merchants viasrc/components/Search/chartGroupByConfig.ts:61(getLabel: (item) => item.formattedMerchant ?? ''->buildChartSeries.ts:21/InsightsDataTable.tsx:110). - Search & Report transaction table rows (
MerchantCell):src/libs/SearchUIUtils.ts:960-961(getTransactionItemCommonFormattedProperties) setsformattedMerchant = isInvalidMerchantValue(merchant) ? '' : merchant, andsrc/libs/TransactionUtils/index.ts:728-739(getMerchantName, used bysrc/components/TransactionItemRow/DataCells/MerchantCell.tsx:26,34on both Search and Expense Report views) returnsmerchantNamewithout unescaping\*.
- Merchant group rows (
-
Critical drill-down query constraint (plus a related bug in
chartGroupByConfig.ts:62):- For Spend > Group by: Merchant,
src/libs/SearchUIUtils.ts:3736-3739passesmerchantGroup.merchantintobuildSpecificGroupQuery(SearchUIUtils.ts:3334-3348), which runsbuildSearchQueryString->sanitizeSearchValue(\->\\) and re-parses it so the backend receives the exact storedmerchantvalue (Google\*cloud). Thus,merchantGroup.merchantmust remain raw forbuildSpecificGroupQuery, whileformattedMerchantis unescaped for display/sorting. - However, in
src/components/Search/chartGroupByConfig.ts:62(Insights > Top Merchants chart drill-down),getFilterQuerycurrently builds`merchant="${item.merchant}"`withoutsanitizeSearchValue(item.merchant)! Whenitem.merchantcontains\*(or"), the Peggy search parser consumes the single\duringquotedStringunescaping, turningmerchant="Google\*cloud"intoGoogle*cloudand causing drill-down clicks on escaped merchants in Insights charts/tables to fail exact matching.
- For Spend > Group by: Merchant,
What changes do we think we should make in order to solve the problem?
-
Add a targeted markdown-punctuation unescape helper (e.g.
unescapeMarkdownPunctuationinsrc/libs/StringUtils.tsorsrc/libs/TransactionUtils/index.ts):- Unescape only backslash-escaped markdown punctuation characters rather than blindly stripping every
\(.), so legitimate literal backslashes before alphanumeric characters (e.g. manually enteredACME\Division) are never corrupted intoACMEDivision:const ESCAPED_MARKDOWN_PUNCTUATION_REGEX = /\([*_~`[\]()#+-.!\])/g; function unescapeMerchantName(merchant: string): string { return merchant.replace(ESCAPED_MARKDOWN_PUNCTUATION_REGEX, '$1'); }
- Unescape only backslash-escaped markdown punctuation characters rather than blindly stripping every
-
Apply
unescapeMerchantNameacross the canonical merchant display formatters while preserving raw filter keys:src/libs/SearchUIUtils.ts:3736-3759(getMerchantSections): KeepmerchantGroup.merchantraw inbuildSpecificGroupQuery(line 3738) and onmerchantGroup.merchant, and set:
This simultaneously fixes Spend > Group by: Merchant (const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : unescapeMerchantName(rawMerchant);MerchantListItemHeader.tsx:28), client-sideformattedMerchantsorting, and Insights > Top Merchants chart/table labels (chartGroupByConfig.ts:61).src/libs/SearchUIUtils.ts:960-961(getTransactionItemCommonFormattedProperties) &src/libs/TransactionUtils/index.ts:728-739(getMerchantName): ApplyunescapeMerchantNamewhen producingformattedMerchantand the final returned string ofgetMerchantNameso Search transaction rows and Report table rows (MerchantCell.tsx:26,34) match the group header cleanly without mutating stored Onyxtransaction.merchant.src/components/Search/chartGroupByConfig.ts:62: Wrapitem.merchantwithsanitizeSearchValue(item.merchant)(merchant="${sanitizeSearchValue(item.merchant)}") so drilling down from Insights > Top Merchants on an escaped merchant preserves the backslash throughparseSearchQuery, matchingbuildSpecificGroupQuery.
-
Add unit & UI tests:
tests/unit/SearchUIUtilsTest.ts: VerifygetMerchantSectionsformatsAsknicely\* Ask Nicely,Dnh\*godaddy.com, andGoogle\*cloudasAsknicely* Ask Nicely,Dnh*godaddy.com, andGoogle*cloudwhile preservingtransactionsQueryJSONexact filter matching and keepingACME\Divisionintact.tests/unit/TransactionUtilsTest.ts&tests/unit/Search/chartGroupByConfigTest.ts: VerifygetMerchantNameunescapes markdown punctuation andCHART_GROUP_BY_CONFIG.merchantproduces unescapedgetLabel+sanitizeSearchValue-escapedgetFilterQuery.
What alternative solutions did you explore? (Optional)
- Replacing all
\(.)globally (merchant.replace(/\(.)/g, '$1')): Rejected because\Din a manually typed merchant likeACME\Divisionis not a markdown escape and would silently drop the backslash. Scoping to escaped markdown punctuation (\([*_~[]()#+-.!])) removes everyExpensiMark` punctuation escape without mangling literal path/code backslashes. - Unescaping only inside
MerchantListItemHeader.tsxorgetMerchantSections: Rejected because expanding a merchant group (Asknicely* Ask Nicely) would still displayAsknicely\* Ask Nicelyinside the expanded transaction rows (MerchantCell/getMerchantName). UpdatinggetMerchantSections,getTransactionItemCommonFormattedProperties, andgetMerchantNamekeeps group headers, Insights charts/tables, and transaction rows consistent.
@FitseTLT Eep! 4 days overdue now. Issues have feelings too...
Not overdue
Issue Analysis
⚠️ Preliminary — encoding source unconfirmed. The display path is verified, but the evidence does not yet establish a safe decoding fix.
What is causing the visible backslashes?
The App preserves incoming merchant strings when displaying them:
- Grouped merchants:
SearchUIUtils.ts:3907–3932copies the raw merchant intoformattedMerchant. - Individual expenses:
SearchUIUtils.ts:1001–1015likewise preserves it.
This explains why an incoming Google\*cloud remains visible. It does not prove where the backslash originated or which surface the original screenshot shows.
Evidence challenging the existing proposals
- Search-query escaping is not the established cause.
sanitizeSearchValueescapes existing backslashes and quotes—not asterisks. The search parser also preserves\*, contrary to the proposed Insights drill-down explanation. - Literal backslashes are possible input. The merchant-entry flow accepts merchant text without establishing a Markdown-encoding contract. Removing every backslash corrupts names such as
ACME\Division; punctuation-only decoding still changes an intentionally literalACME\*Division. - Decoding twice is a risk.
getMerchantNamealready consumesformattedMerchant. Adding decoding both there and during formatting can transform the same value twice.
Recommended next investigation
Before accepting an unescape proposal, obtain:
- The affected view and one transaction identifier.
- That transaction’s raw
merchant/modifiedMerchantand corresponding grouped Search merchant value. - Evidence identifying whether the producer intentionally encodes those values.
If encoding is confirmed, decode that documented representation once, preserving raw values for filtering, editing, and storage. Regression coverage should include the three reported examples, intentional backslashes, consecutive backslashes, and unchanged drill-down matching.
Verification limitation: No browser reproduction or production confirmation was obtained. Production investigation was blocked by unavailable log access and missing customer/request identifiers. The existing proposals identify plausible display locations, but their encoding assumptions remain unverified.
Next Steps: Provide the affected view and a redacted payload comparison to establish the correct fix boundary.
@mountiny the linked slack thread looks internal. So giving update here.
If I understood correctly in the examples you listed the bug is that the merchant is displayed with back slash while the user saved value only included * asterisk right? In that case I don't reproduce it
https://github.com/user-attachments/assets/2757fc47-88d5-46c0-abd8-3c0d941ee0ff
But interestingly I see another weird bug with one of the examples you listed Dnh\*godaddy.com when I save it BE switches it to hj 😕
https://github.com/user-attachments/assets/a8ff63bb-d47d-498d-afa0-71b67a5bf0b3
it might be backend issue then
Added Hot pick