Skip to content

[Due for payment 2026-01-13] [$250] Expense - Old merchant shown on the expense row in the report when edited in Reports #76329

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.2.66-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/folder/13176922/test-cases/41237504
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: iPhone 15 iOS 26.1
App Component: Money Requests

Action Performed:

  1. Sign in to ND
  2. Create two expenses in one report in the workspace chat
  3. Navigate to the Reports tab/ Expenses
  4. Select one of the just created expenses and change the merchant
  5. Navigate to the workspace chat, open the report
  6. Observe the merchant on the expense, where the merchant was edited

Expected Result:

Merchant is updated on the expense row in the expenses list in the report

Actual Result:

Merchant is not updated on the expense row in the expenses list in the report, when the merchant was edited in the Reports tab

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

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021996035559289729199
  • Upwork Job ID: 1996035559289729199
  • Last Price Increase: 2025-12-10
  • Automatic offers:
    • FitseTLT | Reviewer | 109835467
    • mkzie2 | Contributor | 109835472
Issue OwnerCurrent Issue Owner: @lydiabarclay

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 29, 2025
  2. melvin-bot commented on Nov 29, 2025

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (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.

  3. mkzie2 commented on Nov 30, 2025

    @mkzie2
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-12-11 11:44:53 UTC.

    Proposal

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

    Merchant is not updated on the expense row in the expenses list in the report, when the merchant was edited in the Reports tab

    What is the root cause of that problem?

    We use transaction.formattedMerchant for primary merchant calculation in TransactionItemRow:

    let merchant = transactionItem?.formattedMerchant ?? getMerchant(transactionItem);

    formattedMerchant is calculated in FE to better display in search page:

    function getTransactionItemCommonFormattedProperties(
    // eslint-disable-next-line @typescript-eslint/no-deprecated
    transactionItem: SearchTransaction,
    from: OnyxTypes.PersonalDetails,
    to: OnyxTypes.PersonalDetails,
    policy: OnyxTypes.Policy,
    formatPhoneNumber: LocaleContextProps['formatPhoneNumber'],
    report: OnyxTypes.Report | undefined,
    ): Pick<TransactionListItemType, 'formattedFrom' | 'formattedTo' | 'formattedTotal' | 'formattedMerchant' | 'date'> {
    const isExpenseReport = report?.type === CONST.REPORT.TYPE.EXPENSE;
    const fromName = getDisplayNameOrDefault(from);
    const formattedFrom = formatPhoneNumber(fromName);
    // Sometimes the search data personal detail for the 'to' account might not hold neither the display name nor the login
    // so for those cases we fallback to the display name of the personal detail data from onyx.
    let toName = getDisplayNameOrDefault(to, '', false);
    if (!toName && to?.accountID) {
    toName = getDisplayNameOrDefault(getPersonalDetailsForAccountID(to?.accountID));
    }
    const formattedTo = formatPhoneNumber(toName);
    const formattedTotal = getTransactionAmount(transactionItem, isExpenseReport);
    const date = transactionItem?.modifiedCreated ? transactionItem.modifiedCreated : transactionItem?.created;
    const merchant = getTransactionMerchant(transactionItem, policy);
    const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT ? '' : merchant;
    return {
    formattedFrom,
    formattedTo,
    date,
    formattedTotal,
    formattedMerchant,
    };
    }

    When user selects the transaction, we call createAndOpenSearchTransactionThread

    createAndOpenSearchTransactionThread(item, backTo, item?.reportAction?.childReportID, undefined, shouldOpenTransactionThread);

    Calling this merges the transaction item to Onyx storage, this includes props created above

    setOptimisticDataForTransactionThreadPreview(item, previewData, IOUTransactionID);

    App/src/libs/actions/Search.ts

    Lines 1156 to 1160 in 7e199a6

    onyxUpdates.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
    value: item,
    });

    So props like formattedMerchant is also merged to Onyx.

    When updating merchant this value is not updated, so the old value is still displayed.

    TransactionItemRow is used in both Report page and Search page, but we don't see the same issue in Reports > Expenses page, this is because transaction.formattedMerchant was recalculated in Search page:

    const [filteredData1, allLength] = getSections({
    type,
    data: searchResults.data,
    currentAccountID: accountID,
    currentUserEmail: email ?? '',
    formatPhoneNumber,
    groupBy: validGroupBy,
    reportActions: exportReportActions,
    currentSearch: searchKey,
    archivedReportsIDList: archivedReportsIdSet,
    queryJSON,
    isActionLoadingSet,
    });

    return getTransactionsSections(data, currentSearch, currentAccountID, currentUserEmail, formatPhoneNumber, isActionLoadingSet);

    App/src/libs/SearchUIUtils.ts

    Lines 1099 to 1106 in f82a8db

    const {formattedFrom, formattedTo, formattedTotal, formattedMerchant, date} = getTransactionItemCommonFormattedProperties(
    transactionItem,
    from,
    to,
    policy,
    formatPhoneNumber,
    report,
    );

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

    Since the values created by getTransactionItemCommonFormattedProperties is only used temporarily and calculated on-the-go, we don't need those values stored. So we should exclude props created by getTransactionItemCommonFormattedProperties when merging here.

            const {formattedFrom, formattedMerchant, formattedTo, formattedTotal, date, ...restItem} = item;
            onyxUpdates.push({
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
                value: restItem,
            });

    App/src/libs/actions/Search.ts

    Lines 1156 to 1160 in 7e199a6

    onyxUpdates.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
    value: item,
    });

    What alternative solutions did you explore? (Optional)

    These alternate solutions can be implemented together with main solution.

    Alternate 1:

    We can use the same logics in SearchUIUtils to recalculate merchant in MoneyRequestReportTransactionList

    const merchant = getTransactionMerchant(transactionItem, policy);
    const formattedMerchant = merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT ? '' : merchant;

    formattedMerchant: getMerchant(transaction, policy) === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT ? '' : getMerchant(transaction, policy),

    .map((transaction) => ({
    ...transaction,
    shouldBeHighlighted: newTransactions?.includes(transaction),
    }));

    Alternate 2:

    Looking at formattedMerchant description:

    /** formatted "merchant" value used for displaying and sorting on Reports page */
    formattedMerchant?: string;

    We see that this value is only used in Report > Expenses page, so we can limit its usage here:

    let merchant = (isSearchTopmostFullScreenRoute() ? transactionItem?.formattedMerchant : undefined) ?? getMerchant(transactionItem);

    let merchant = transactionItem?.formattedMerchant ?? getMerchant(transactionItem);

    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.

  4. melvin-bot commented on Dec 3, 2025

    @melvin-bot

    @lydiabarclay Whoops! This issue is 2 days overdue. Let's get this updated quick!

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 3, 2025
  6. changed the title [-]Expense - Old merchant shown on the expense row in the report when edited in Reports[/-] [+][$250] Expense - Old merchant shown on the expense row in the report when edited in Reports[/+] on Dec 3, 2025
  7. melvin-bot commented on Dec 3, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 3, 2025
  9. melvin-bot commented on Dec 3, 2025

    @melvin-bot

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

  10. 20 remaining items

  11. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 6, 2026
  12. changed the title [-][$250] Expense - Old merchant shown on the expense row in the report when edited in Reports[/-] [+][Due for payment 2026-01-13] [$250] Expense - Old merchant shown on the expense row in the report when edited in Reports[/+] on Jan 6, 2026
  13. melvin-bot commented on Jan 6, 2026

    @melvin-bot

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

  14. melvin-bot commented on Jan 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.93-1 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 2026-01-13. 🎊

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

  15. melvin-bot commented on Jan 6, 2026

    @melvin-bot

    @mollfpr @lydiabarclay @FitseTLT / @mkzie2 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]

  16. lydiabarclay commented on Jan 12, 2026

    @lydiabarclay
    Contributor

    @FitseTLT can you fill out the bz checklist here ahead of the payment date tomorrow?

  17. FitseTLT commented on Jan 13, 2026

    @FitseTLT
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Test:

    1. Create two expenses in one report in the workspace chat
    2. Navigate to the Reports > Expenses tab
    3. Select one of the just-created expenses and change the merchant
    4. Navigate to the workspace chat, open the report
    5. Verify that the merchant is correctly updated on the transaction list.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-378e-a621-b0bb-2f05dd469444
  18. lydiabarclay commented on Jan 13, 2026

    @lydiabarclay
    Contributor

    Payment Summary

    Contributor: @mkzie2 paid $250 via Upwork
    Contributor+: @FitseTLT paid $250 via Upwork

    ✅ Regression test filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions