Skip to content

[Due for payment 2026-10-21] [$175] Wallet - Legacy combo Expensify Card appears as two rows with the same last four digits #101428

Closed

Description

@melvin-bot

Action Performed

  1. Sign in as an account holding a legacy combo Expensify Card (paired physical + virtual card).
  2. Go to Settings > Wallet.

Expected Result
The combo card shows as a single row, as it did before the walletConnectionStatus beta was removed.

Actual Result
The physical and virtual halves of the combo card render as two separate rows with the same ending digits and the same information, which is confusing.

Root cause
PaymentMethodList only collapses same-domain Expensify Cards into one row when shouldShowConnectionStatus is off:

if (!shouldShowConnectionStatus && assignedCardsGrouped.some((item) => item.isGroupedCardDomain && item.description === card.domainName) && !isAdminIssuedVirtualCard) {

(in PaymentMethodList.tsx)

Remove the walletConnectionStatus beta changed the assigned-cards list in WalletPage/index.tsx from shouldShowConnectionStatus={shouldShowWalletConnectionStatus} to always-on, so grouping is now permanently skipped on the Wallet page. Nothing else dedupes combo pairs there — getAssignedCardSortKey only sorts the physical card first.

Proposed fix
Restore single-row grouping for combo cards on the Wallet page while keeping connection status/sync details visible. Combo cards are deprecated (no new ones can be created), but legacy ones still exist and should display the way they did before.

Platforms: all

Reported in Slack.

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 17, 2026
  2. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 17, 2026
  3. melvin-bot commented on Sep 17, 2026

    @melvin-bot
    Author

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

  4. melvin-bot commented on Sep 17, 2026

    @melvin-bot
    Author

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  5. MelvinBot commented on Sep 17, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The Wallet page's combo-card grouping branch is now permanently dead code.

    PaymentMethodList.tsx:446 only merges a second same-domain Expensify Card into an existing row when !shouldShowConnectionStatus. Remove the walletConnectionStatus beta replaced shouldShowConnectionStatus={shouldShowWalletConnectionStatus} with a hardcoded shouldShowConnectionStatus on both lists in WalletPage/index.tsx:723-731. WalletPage is the only caller that passes shouldShowAssignedCards, so the guard is now always false and both halves of a combo card fall through to the row push at :478.

    The two rows look identical because both halves share domainName (same description) and have no cardTitle override (both fall back to card.bank). The last four is only appended to the description when nameValuePairs.issuedBy is set, which legacy combo halves do not have — see :466-471.

    The gate conflates two unrelated things. Connection status does not apply to Expensify Cards at all: shouldShowCardLastSync at :328 excludes Expensify cards, and getCardConnectionStatusDisplay returns only an active/inactive badge for them. So grouping never needed to be disabled for connection status to work.

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

    Two changes in PaymentMethodList.tsx:

    1. Drop the !shouldShowConnectionStatus term from the merge condition at :446-447. This alone restores the pre-regression single row. The merge body only folds errors and recomputes brickRoadIndicator, so no status or sync detail is lost, and the isAdminIssuedVirtualCard check keeps genuinely separate admin-issued virtual cards on their own rows.

    2. Match on card.domainName, not the rendered description. The condition compares item.description === card.domainName, but the description comes from getDescriptionForPolicyDomainCard, which returns the policy name for workspace-feed domains. That comparison silently fails there. Carry domainName on the pushed item (next to the existing isGroupedCardDomain field in PaymentMethodItem) and key the merge off that instead.

    Ordering already works: getAssignedCardSortKey puts the physical card first, so it becomes the surviving row, and the detail page it navigates to already renders both halves via getDomainCards. No change needed there.

    Add a regression test. There is no test file for PaymentMethodList anywhere in tests/, which is how this slipped through. A test asserting one row for a combo pair and two rows for a physical card plus an admin-issued virtual card would lock the behavior in.

    What alternative solutions did you explore? (Optional)

    Alternatives considered, and one discrepancy in the report

    Reuse getDisplayableExpensifyCards. This helper already does the correct domain-keyed collapse with the same isAdminIssuedVirtualCard guard, and it is unit tested. It is why the home "Your Spend" section shows one row while Wallet shows two — its only caller is useYourSpendData.ts:423. I'd avoid swapping it in wholesale, though: it also filters expired, zero-limit, and pending-issue/activate cards, so it would change which cards appear in Wallet at all — a wider behavior change than this bug warrants. It is still the right reference for the merge key.

    Dedupe on lastFourPAN. Rejected. Every combo fixture in the repo gives the two halves different last fours (CardUtilsTest.ts:2745-2782, WalletExpensifyCardPageTest.tsx:280), so matching on it would both miss real pairs and risk collapsing unrelated cards. CardUtils.ts also documents explicitly that the "one domain ⇒ one physical+virtual pair" invariant holds only for Expensify cards, so any collapse must stay gated on isExpensifyCard.

    Revert the beta removal. Rejected — it would take the connection-status feature down with it. The two concerns are independent.

    One discrepancy worth noting: the report says the two rows show "the same ending digits", but per the description logic above, combo cards don't render a last four at all. The visible duplication is the title and domain/policy name. This doesn't change the root cause or the fix, but whoever verifies should expect two rows reading the same card name and domain rather than two visible "••1234" strings.

    Verification note: I did not reproduce this on a live account — it needs an account holding a legacy combo card, which can't be provisioned (no new combo cards can be created). The root cause is static and unambiguous: a permanently-false guard on the only code path that collapses the pair.

    Related issues: I searched open App issues for combo-card, duplicate-wallet-row, and walletConnectionStatus matches and found none covering this.

    💡 Suggested AI code review rule

    This looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App:

    • Rule: CONSISTENCY-18 — Resolve every branch on a flag you hardcode
    • Condition: When a PR removes a beta or feature flag and replaces its reads with a hardcoded value, flag it unless every other branch on that flag — including negated ones in other files — has been resolved and its now-unreachable code deleted or rewritten. Hardcoding the enabled value silently disables anything guarded by the negation.
    • Why: The flag becomes a compile-time constant, so branches on its negation turn into dead code that no test or type check flags. Here it silently removed combo-card grouping from Settings > Wallet.
    • Search pattern: when a PR deletes an entry from CONST.BETAS or drops a usePermissions()/isBetaEnabled() read, grep the repo for the flag and the prop or variable it fed — !<name>, <name> &&, <name> ? — and treat any surviving branch on the negation as dead.
    • Offending code (❌): WalletPage/index.tsx:723-731 hardcodes the prop; the branch it killed is PaymentMethodList.tsx:446.
    • Fix (✅): the change described in this proposal.

    The full rule file, with the ❌/✅ code inline in App's app-coding-standards format, would go in Expensify/App itself. If it's worth adding, a maintainer can open it there as a draft PR.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/101428) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  6. FitseTLT commented on Sep 22, 2026

    @FitseTLT
    Contributor

    Will review tomorrow

  7. melvin-bot commented on Sep 25, 2026

    @melvin-bot
    Author

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

  8. FitseTLT commented on Sep 25, 2026

    @FitseTLT
    Contributor

    Will review on Monday

  9. melvin-bot commented on Sep 29, 2026

    @melvin-bot
    Author

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

  10. 26 remaining items

  11. changed the title [-][$175] Wallet - Legacy combo Expensify Card appears as two rows with the same last four digits[/-] [+][Due for payment 2026-10-21] [$175] Wallet - Legacy combo Expensify Card appears as two rows with the same last four digits[/+] on Oct 14, 2026
  12. melvin-bot commented on Oct 14, 2026

    @melvin-bot
    Author

    @FitseTLT

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.8-5 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-10-21. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  13. FitseTLT commented on Oct 14, 2026

    @FitseTLT
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: https://github.com/Expensify/App/pull/99754/changes#r4271210965
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A — cosmetic duplicate-row display bug, not a core-flow blocker.

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    • Sign in with an account that has a legacy combo Expensify Card (paired physical + virtual card, same domain). If unavailable, paste this into the browser console instead:
    Combo card mock (paste into the JS console)
    Onyx.set("cardList", {
    	200: {
    		accountID: 20410919,
    		availableSpend: 100,
    		bank: "Expensify Card",
    		cardID: 200,
    		cardName: "455594XXXXXX1234",
    		domainName: "expensify-policydAAA.exfy",
    		fraud: "none",
    		fundID: "123456",
    		isVirtual: true,
    		lastFourPAN: "1234",
    		lastScrape: "",
    		lastScrapeResult: 200,
    		nameValuePairs: {
    			cardTitle: "My virtual card",
    			expirationDate: "2029-03-31",
    			feedCountry: "US",
    			hasCustomUnapprovedExpenseLimit: true,
    			isVirtual: true,
    			limitType: "fixed",
    			unapprovedExpenseLimit: 5000,
    		},
    		scrapeMinDate: "",
    		state: 3,
    		token: "ABC-XYZ-V",
    	},
    	1000: {
    		accountID: 20410919,
    		availableSpend: 100,
    		bank: "Expensify Card",
    		cardID: 1000,
    		cardName: "455594XXXXXX1234",
    		domainName: "expensify-policydAAA.exfy",
    		fraud: "none",
    		fundID: "123456",
    		isVirtual: false,
    		lastFourPAN: "1234",
    		lastScrape: "",
    		lastScrapeResult: 200,
    		nameValuePairs: {
    			cardTitle: "My physical card",
    			expirationDate: "2029-03-31",
    			feedCountry: "US",
    			hasCustomUnapprovedExpenseLimit: true,
    			isVirtual: false,
    			limitType: "fixed",
    			unapprovedExpenseLimit: 5000,
    		},
    		scrapeMinDate: "",
    		state: 3,
    		token: "ABC-XYZ-V",
    	}
    });

    Test:

    1. Go to Settings > Wallet.
    2. Verify the combo card shows as one row titled My physical card, not two rows with the same 1234 ending.

    Do we agree 👍 or 👎

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 14, 2026
  15. melvin-bot commented on Oct 20, 2026

    @melvin-bot
    Author

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Oct 20, 2026

    @melvin-bot
    Author

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. mallenexpensify commented on Oct 21, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @FitseTLT due $250 via NewDot

    Assigned before 2026-09-19

  18. flaviadefaria commented on Oct 23, 2026

    @flaviadefaria
    Contributor

    Approved: @FitseTLT due $250 via NewDot

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