App icon indicating copy to clipboard operation
App copied to clipboard

[$175] Merchant list displays escape characters

Open melvin-bot[bot] opened this issue 3 weeks ago • 25 comments

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
Issue OwnerCurrent Issue Owner: @shubham1206agra

melvin-bot[bot] avatar Nov 09 '26 20:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 09 '26 20:11 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022119889882405572392

melvin-bot[bot] avatar Nov 09 '26 20:11 melvin-bot[bot]

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:

  1. In src/libs/SearchUIUtils.ts:940–941 inside getTransactionItemCommonFormattedProperties:
    const merchant = getTransactionMerchant(transactionItem);
    const formattedMerchant = isInvalidMerchantValue(merchant) ? '' : merchant;
    
    merchant contains the raw escaped string and is assigned directly to formattedMerchant.
  2. In src/libs/SearchUIUtils.ts:3690 inside getMerchantGroupSections:
    const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : rawMerchant;
    
    rawMerchant contains the raw escaped string for the section header.
  3. In src/libs/TransactionUtils/index.ts:1680–1695 inside getMerchantName:
    const merchantName = StringUtils.getFirstLine(merchant);
    
    Consumes merchant directly without unescaping.

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

  1. Add unescape utility in src/libs/StringUtils/index.ts (or src/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');
    }
    
  2. 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);
      
  3. In src/libs/TransactionUtils/index.ts inside getMerchantName:

    const cleanMerchant = StringUtils.unescape(merchant);
    const merchantName = StringUtils.getFirstLine(cleanMerchant);
    
  4. Add unit test coverage:

    • In tests/unit/StringUtilsTest.ts: Verify that StringUtils.unescape properly 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 in describe('getMerchantName') verifying that transactions with escaped characters return clean unescaped merchant names.
    • In tests/unit/SearchUIUtilsTest.ts: Verify that getTransactionItemCommonFormattedProperties returns unescaped formattedMerchant.

What alternative solutions did you explore? (Optional)

  • Unescaping only in TransactionUtils.getMerchantName: Rejected because Search table columns and Group-by-Merchant headers construct formattedMerchant directly via SearchUIUtils.ts. Updating both SearchUIUtils and TransactionUtils guarantees uniform display everywhere.

Tests

  1. Navigate to Search > Expenses.
  2. Group by Merchant or view the Merchant table column for transactions containing special characters (e.g., *, _).
  3. Verify that the merchant name renders cleanly without visible backslashes (e.g. Asknicely* Ask Nicely, Dnh*godaddy.com, Google*cloud).
  4. 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

kevinjosh10 avatar Nov 09 '26 20:11 kevinjosh10

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 09 '26 20:11 melvin-bot[bot]

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

khizzcr7 avatar Nov 10 '26 00:11 khizzcr7

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 10 '26 00:11 melvin-bot[bot]

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.

Stephen3453 avatar Nov 10 '26 05:11 Stephen3453

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:

  1. Group-by-Merchant view (group-by:merchant / Top Merchants): In src/libs/SearchUIUtils.ts (getMerchantSections(), lines 3657–3698), rawMerchant = merchantGroup.merchant is assigned directly to formattedMerchant at 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 passes merchantItem.formattedMerchant ?? merchantItem.merchant ?? '' directly to BaseListItemHeader (CONST.SEARCH.TABLE_COLUMNS.GROUP_MERCHANT), src/libs/getSearchColumnContentToMeasure.ts (line 192) measures item.formattedMerchant, and src/pages/Insights/charts/InsightsDataTable.tsx displays item.formattedMerchant as-is.
  2. Expense rows (CONST.SEARCH.TABLE_COLUMNS.MERCHANT): In src/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 by getMerchantName() in src/libs/TransactionUtils/index.ts (lines 723–734) and rendered in src/components/TransactionItemRow/DataCells/MerchantCell.tsx (line 34, where !isDescription bypasses Parser.htmlToText).

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

  1. Add a helper unescapeMerchantName(merchant: string): string in src/libs/TransactionUtils/index.ts that strips markdown/escape backslashes preceding punctuation (merchant.replace(/\\([*_~[]()#+-.!])/g, '$1')ormerchant.replace(/\(.)/g, '$1')`):
    function unescapeMerchantName(merchant: string): string {
        return merchant.replace(/\\(.)/g, '$1');
    }
    
  2. Apply unescapeMerchantName to display-facing merchant values while preserving the raw merchant key for search drill-down queries:
    • In src/libs/SearchUIUtils.ts (getMerchantSections(), lines 3668–3684): keep merchantGroup.merchant unchanged in buildSpecificGroupQuery(queryJSON, CONST.SEARCH.SYNTAX_FILTER_KEYS.MERCHANT, ...) at line 3670 so expanding/drilling into a merchant group still queries the exact backend key, and unescape formattedMerchant at line 3683:
      const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : unescapeMerchantName(rawMerchant);
      
    • In src/libs/SearchUIUtils.ts (getTransactionItemCommonFormattedProperties(), line 934) and src/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) render Asknicely* Ask Nicely, Dnh*godaddy.com, and Google*cloud consistently, and alphabetical sorting on formattedMerchant (transactionMerchantGroupColumnNamesToSortingProperty at src/libs/SearchUIUtils.ts:457) sorts by the unescaped display text.
  3. Add unit tests in tests/ui/MerchantListItemHeaderTest.tsx and tests/unit/Search/SearchUIUtilsTest.ts covering escaped merchant strings (Asknicely\* Ask Nicely, Dnh\*godaddy.com, Google\*cloud).

What alternative solutions did you explore? (Optional)

  • Unescaping only in MerchantCell.tsx or only in getMerchantName(): Misses getMerchantSections() in src/libs/SearchUIUtils.ts:3683, where MerchantListItemHeader.tsx reads merchantItem.formattedMerchant directly without calling getMerchantName or rendering MerchantCell.
  • Unescaping merchantGroup.merchant before buildSpecificGroupQuery() (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; keeping merchantGroup.merchant for buildSpecificGroupQuery and unescaping formattedMerchant isolates the change to display and sorting.

khoap1220-hue avatar Nov 10 '26 08:11 khoap1220-hue

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:

  1. 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.merchant escaped for search query filter syntax (e.g. Google\*cloud) so it can be passed safely to buildSpecificGroupQuery(..., SYNTAX_FILTER_KEYS.MERCHANT, merchantGroup.merchant). However, formattedMerchant is assigned rawMerchant without stripping the query escape backslashes before rendering.

  2. 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, formattedMerchant preserves the raw escape backslashes into the UI table cells.

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

  1. 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.merchant intact for drill-down search queries (buildSpecificGroupQuery), while ensuring the UI formattedMerchant displays the clean name without backslashes.

    • In getSearchFormattedProperties: Sanitize formattedMerchant when 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

  1. Navigate to the Search page (/search).
  2. 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).
  3. Verify that the Merchant column and grouped merchant section headers display clean names without literal backslashes (Asknicely* Ask Nicely).
  4. 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

jmquero92 avatar Nov 10 '26 13:11 jmquero92

:warning: Unable to store contributor details

Details
Auth SetContributorDetails returned an error
401 Contributor details already exist

melvin-bot[bot] avatar Nov 10 '26 13:11 melvin-bot[bot]

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?

  1. In src/libs/StringUtils.ts:
    • Ensure an HTML entity decoder (or decodeHTMLEntities) is available for sanitized display strings.
  2. In src/pages/iou/request/step/IOURequestStepMerchant.tsx and 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.

TassioSales avatar Nov 11 '26 13:11 TassioSales

@FitseTLT Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 12 '26 21:11 melvin-bot[bot]

Not overdue

FitseTLT avatar Nov 13 '26 15:11 FitseTLT

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?

  1. 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 (\*, \_, \~) so ExpensiMark (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 *.
  2. All plain-text merchant display paths render the escaped string verbatim without unescaping markdown punctuation:

  3. Critical drill-down query constraint (plus a related bug in chartGroupByConfig.ts:62):

    • For Spend > Group by: Merchant, src/libs/SearchUIUtils.ts:3736-3739 passes merchantGroup.merchant into buildSpecificGroupQuery (SearchUIUtils.ts:3334-3348), which runs buildSearchQueryString -> sanitizeSearchValue (\ -> \\) and re-parses it so the backend receives the exact stored merchant value (Google\*cloud). Thus, merchantGroup.merchant must remain raw for buildSpecificGroupQuery, while formattedMerchant is unescaped for display/sorting.
    • However, in src/components/Search/chartGroupByConfig.ts:62 (Insights > Top Merchants chart drill-down), getFilterQuery currently builds `merchant="${item.merchant}"` without sanitizeSearchValue(item.merchant)! When item.merchant contains \* (or "), the Peggy search parser consumes the single \ during quotedString unescaping, turning merchant="Google\*cloud" into Google*cloud and causing drill-down clicks on escaped merchants in Insights charts/tables to fail exact matching.

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

  1. Add a targeted markdown-punctuation unescape helper (e.g. unescapeMarkdownPunctuation in src/libs/StringUtils.ts or src/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 entered ACME\Division) are never corrupted into ACMEDivision:
      const ESCAPED_MARKDOWN_PUNCTUATION_REGEX = /\([*_~`[\]()#+-.!\])/g;
      
      function unescapeMerchantName(merchant: string): string {
          return merchant.replace(ESCAPED_MARKDOWN_PUNCTUATION_REGEX, '$1');
      }
      
  2. Apply unescapeMerchantName across the canonical merchant display formatters while preserving raw filter keys:

    • src/libs/SearchUIUtils.ts:3736-3759 (getMerchantSections): Keep merchantGroup.merchant raw in buildSpecificGroupQuery (line 3738) and on merchantGroup.merchant, and set:
      const formattedMerchant = isEmptyMerchant ? translate('search.noMerchant') : unescapeMerchantName(rawMerchant);
      
      This simultaneously fixes Spend > Group by: Merchant (MerchantListItemHeader.tsx:28), client-side formattedMerchant sorting, 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): Apply unescapeMerchantName when producing formattedMerchant and the final returned string of getMerchantName so Search transaction rows and Report table rows (MerchantCell.tsx:26,34) match the group header cleanly without mutating stored Onyx transaction.merchant.
    • src/components/Search/chartGroupByConfig.ts:62: Wrap item.merchant with sanitizeSearchValue(item.merchant) (merchant="${sanitizeSearchValue(item.merchant)}") so drilling down from Insights > Top Merchants on an escaped merchant preserves the backslash through parseSearchQuery, matching buildSpecificGroupQuery.
  3. Add unit & UI tests:

    • tests/unit/SearchUIUtilsTest.ts: Verify getMerchantSections formats Asknicely\* Ask Nicely, Dnh\*godaddy.com, and Google\*cloud as Asknicely* Ask Nicely, Dnh*godaddy.com, and Google*cloud while preserving transactionsQueryJSON exact filter matching and keeping ACME\Division intact.
    • tests/unit/TransactionUtilsTest.ts & tests/unit/Search/chartGroupByConfigTest.ts: Verify getMerchantName unescapes markdown punctuation and CHART_GROUP_BY_CONFIG.merchant produces unescaped getLabel + sanitizeSearchValue-escaped getFilterQuery.

What alternative solutions did you explore? (Optional)

  • Replacing all \(.) globally (merchant.replace(/\(.)/g, '$1')): Rejected because \D in a manually typed merchant like ACME\Division is not a markdown escape and would silently drop the backslash. Scoping to escaped markdown punctuation (\([*_~[]()#+-.!])) removes every ExpensiMark` punctuation escape without mangling literal path/code backslashes.
  • Unescaping only inside MerchantListItemHeader.tsx or getMerchantSections: Rejected because expanding a merchant group (Asknicely* Ask Nicely) would still display Asknicely\* Ask Nicely inside the expanded transaction rows (MerchantCell / getMerchantName). Updating getMerchantSections, getTransactionItemCommonFormattedProperties, and getMerchantName keeps group headers, Insights charts/tables, and transaction rows consistent.

cocvn157 avatar Nov 13 '26 16:11 cocvn157

@FitseTLT Eep! 4 days overdue now. Issues have feelings too...

Not overdue

FitseTLT avatar Nov 18 '26 22:11 FitseTLT

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:

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. sanitizeSearchValue escapes 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 literal ACME\*Division.
  • Decoding twice is a risk. getMerchantName already consumes formattedMerchant. Adding decoding both there and during formatting can transform the same value twice.

Recommended next investigation

Before accepting an unescape proposal, obtain:

  1. The affected view and one transaction identifier.
  2. That transaction’s raw merchant/modifiedMerchant and corresponding grouped Search merchant value.
  3. 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.


view run

MelvinBot avatar Nov 24 '26 16:11 MelvinBot

@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

FitseTLT avatar Nov 24 '26 16:11 FitseTLT

it might be backend issue then

image

mountiny avatar Nov 25 '26 01:11 mountiny

Added Hot pick

FitseTLT avatar Nov 25 '26 11:11 FitseTLT