Skip to content

[$250] Merchant rules - Preview matches do not display the receipt preview #82175

Closed

Description

@lanitochka17

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: v9.3.17-5
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #81033
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11, Chrome | iPhone SE 3rd generation, Tahoe 26.2.1 | Samsung A15, Android 16
App Component: Workspace Settings

Action Performed:

Preconditions:

  • User is an admin of a workspace with rules enabled.
  1. Go to https://staging.new.expensify.com/
  2. Create an expense in the WS, add a receipt and set the merchant as 'Uber'.
  3. Navigate to Workspaces > [Current workspace] > Rules > Add merchant rule
  4. For expenses with: set the merchant as 'Uber', save it.
  5. Click Preview matches

Expected Result:

Preview matches under Merchant rules should display the receipt thumbnail.

Actual Result:

Preview matches under Merchant rules do not display the receipt thumbnail.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7075035_1770837176131.explorer_rsEDyFs8Y9.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @luacmartins
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022021668705202993626
  • Upwork Job ID: 2021668705202993626
  • Last Price Increase: 2026-02-11

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 11, 2026
  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 11, 2026
  3. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 11, 2026
  4. melvin-bot commented on Feb 11, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #81033

  5. melvin-bot commented on Feb 11, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. melvin-bot commented on Feb 11, 2026

    @melvin-bot

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

  7. melvin-bot commented on Feb 11, 2026

    @melvin-bot

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

  8. changed the title [-]Merchant rules - Preview matches do not display the receipt preview[/-] [+][$250] Merchant rules - Preview matches do not display the receipt preview[/+] on Feb 11, 2026
  9. melvin-bot commented on Feb 11, 2026

    @melvin-bot
  10. 1 remaining item

  11. github-actions commented on Feb 11, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  12. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 11, 2026
  13. OSBotify commented on Feb 11, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #80758 - "[NO QA] Add preview expenses to merchant rules" by @JS00001 (High confidence)
    Related Issues: None

    Recommendation: ROLL FORWARD

    The bug exists in the PreviewMatchesPage component which passes raw Transaction objects to UnreportedExpenseListItem, but the component expects TransactionListItemType (which includes ListItem properties like keyForList, text, etc.). This causes the receipt thumbnails to not display properly because TransactionItemRow cannot access the necessary display properties.

    Rolling forward with a fix is recommended because:

    1. The causing PR ([NO QA] Add preview expenses to merchant rules #80758) was merged on 2026-01-29, well before the current staging deploy
    2. Multiple dependent PRs have been merged since then (Remove dev lock from merchant rules #80853, Enable merchant rules #81033, fix Expense - Merchant can be made empty by using Expense as Merchant in expense rule #81205, Add markdown to rule description #81220, Validate merchant input #81224)
    3. Reverting would remove the entire merchant rules preview feature
    4. The fix is straightforward: transform Transaction objects to TransactionListItemType before passing to UnreportedExpenseListItem

    Labels: Keeping DeployBlockerCash - this is a frontend bug in the App repository that needs to be fixed before deploying to production.

    Detailed Analysis

    Evidence

    PR #80758 created the PreviewMatchesPage component on 2026-01-29. The code at lines 70-76 shows:

    const renderItem: ListRenderItem<Transaction> = ({item}) => (
        <UnreportedExpenseListItem
            readOnly
            showTooltip
            item={item}
            onSelectRow={() => {}}
        />
    );

    The Transaction object from Onyx is passed directly to UnreportedExpenseListItem without transformation.

    Verification

    File: /home/runner/_work/App/App/src/pages/workspace/rules/MerchantRules/PreviewMatchesPage.tsx

    • Lines 63-77 show raw Transaction objects are fetched from Onyx and passed to UnreportedExpenseListItem
    • UnreportedExpenseListItem expects items that conform to TransactionListItemType (ListItem & Transaction)
    • The component chain is: PreviewMatchesPage -> UnreportedExpenseListItem -> TransactionItemRow -> ReceiptCell

    File: /home/runner/_work/App/App/src/components/SelectionListWithSections/types.ts

    • Lines 260-287 define TransactionListItemType which extends both ListItem and Transaction
    • ListItem type (lines 142-239) includes properties like keyForList, text, icons, etc. that are not present in raw Transaction objects

    Root Cause

    The PreviewMatchesPage fetches Transaction objects from ONYXKEYS.COLLECTION.CODING_RULE_MATCHING_TRANSACTION and passes them directly to UnreportedExpenseListItem without converting them to TransactionListItemType. The UnreportedExpenseListItem then passes these to TransactionItemRow which expects the full TransactionListItemType interface with all ListItem properties populated. Without these properties, the TransactionItemRow cannot properly render the receipt thumbnails and other display elements.

    The bug was introduced in PR #80758 but only became visible to users when PR #81033 removed the production environment check on 2026-02-10, enabling merchant rules for all users.

    Why PR #81033 is Not the Cause

    PR #81033 only removed 6 lines of code that checked isProduction and returned null. It did not introduce any new logic or modify how the PreviewMatchesPage works. The bug already existed in the codebase from PR #80758, but was hidden behind the production flag.

  14. luacmartins commented on Feb 11, 2026

    @luacmartins
    Contributor

    BE PR in review. This is NAB.

  15. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Feb 11, 2026
  16. luacmartins commented on Feb 12, 2026

    @luacmartins
    Contributor
  17. zhanglin2603 commented on Feb 13, 2026

    @zhanglin2603

    Hey, I went over #82175 and can take this on.

    • My read: this is documentation-focused work for "[$250] Merchant rules - Preview matches do not display the receipt preview".
    • I will focus on these issue-specific points first: merchant, rules, preview.
    • Confirm audience and acceptance criteria, then draft reproducible steps.
    • Add concrete examples and edge cases so contributors can follow directly.
    • Keep progress updates clear (24h for scoped implementation plan, 48h+ for full patch and validation).
      If this scope looks good, I can begin right away.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions