Skip to content

[$250] Virtual Expensify Cards are not displayed on the Wallet page in New Expensify, preventing users from viewing and accessing their issued virtual cards. #95956

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.32-3
Reproducible in staging?: Needs Reproduction (Unable to reproduce)
Reproducible in production?: Needs Reproduction
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @PedroEspinoza1999
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Sign in to New Expensify with an account that has one or more active Virtual Expensify Cards.
  2. Navigate to Settings > Wallet.
  3. Review the list of available payment methods and cards.

Expected Result:

All active assigned Virtual Expensify Cards should appear on the Wallet page, allowing the user to view and manage them.

Actual Result:

The Virtual Expensify Cards do not appear on the Wallet page, even though they have been issued and are active.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

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

Screenshots/Videos

The screenshots for the issue are in Slack thread

View all open jobs on GitHub

Upwork Automation - Do Not Edit

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 13, 2026
  2. exfy-zapier commented on Jul 13, 2026

    @exfy-zapier

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  3. MelvinBot commented on Jul 13, 2026

    @MelvinBot
    Contributor

    ⚠️ Something went wrong. This may be a transient issue — try again. If it persists, check status.anthropic.com.

    Run details

  4. MelvinBot commented on Jul 13, 2026

    @MelvinBot
    Contributor

    ⚠️ Something went wrong. This may be a transient issue — try again. If it persists, check status.anthropic.com.

    Run details

  5. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 13, 2026
  6. MelvinBot commented on Jul 13, 2026

    @MelvinBot
    Contributor

    ⚠️ Something went wrong. This may be a transient issue — try again. If it persists, check status.anthropic.com.

    Run details

  7. MelvinBot commented on Jul 13, 2026

    @MelvinBot
    Contributor

    ⚠️ Something went wrong. This may be a transient issue — try again. If it persists, check status.anthropic.com.

    Run details

  8. 16 remaining items

  9. yusufdeveloper2903 commented on Jul 13, 2026

    @yusufdeveloper2903
    Contributor

    Proposal

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

    On Settings → Wallet, an active, assigned Virtual Expensify Card can be missing from the "Assigned cards" list — the user has an issued and active virtual card, but no row for it renders.

    What is the root cause of that problem?

    The Wallet page does not build the assigned-cards list itself — it delegates to PaymentMethodList with shouldShowAssignedCards at WalletPage/index.tsx:732-739. All of the filtering and grouping that decides whether a card gets a row happens inside that component.

    After the active-card filter at PaymentMethodList.tsx:226-234, the surviving Expensify cards are sorted so the physical card of a domain comes before its virtual twin — getAssignedCardSortKey returns 0 for physical, 1 for virtual (CardUtils.ts:165-170). The first card of a domain is pushed as a grouped domain row (isGroupedCardDomain: !isAdminIssuedVirtualCard, PaymentMethodList.tsx:364-383). Every later card that lands on that domain is then folded into the existing row and continue-skipped — it gets no row of its own (PaymentMethodList.tsx:341-355):

    const isAdminIssuedVirtualCard = !!card?.nameValuePairs?.issuedBy && !!card?.nameValuePairs?.isVirtual;
    // ...
    if (assignedCardsGrouped.some((item) => item.isGroupedCardDomain && item.description === card.domainName) && !isAdminIssuedVirtualCard) {
        // merge errors into the existing domain row …
        continue; // <-- the card renders NO row
    }

    The only escape hatch that lets a virtual card keep its own row is isAdminIssuedVirtualCard, and that flag is true only when both nameValuePairs.issuedBy and nameValuePairs.isVirtual are set. This is where legitimate virtual cards fall through:

    • The issuedBy requirement is too strict. A virtual Expensify card that is active but whose nameValuePairs.issuedBy is not populated (virtual cards issued through flows that don't stamp issuedBy) fails the isAdminIssuedVirtualCard test. If any other card of the same domainName was already pushed as a grouped domain row, the virtual card is treated as the virtual half of a combo pair and absorbed — it disappears from the list, even though it is a real, separately-usable card.
    • The domain match is done on the display string, not the domain. The merge keys on item.description === card.domainName, but the grouped row's description was set via getDescriptionForPolicyDomainCard(card.domainName, …) (PaymentMethodList.tsx:360-363), which for a workspace feed returns the policy name, not the raw domainName (PolicyUtils.ts:2678-2686). So "does a group for this domain exist?" is answered by comparing a human-readable label against the raw domain — a comparison that silently behaves differently for plain domains vs. workspace feeds, making the grouping fragile and data-shape-dependent.

    History of how we got here: the per-domain grouping and the isAdminIssuedVirtualCard escape hatch were both introduced in PR #38998 (commit 0515ffbd7da, "make wallet page cards grouped by domain"). The intent was correct — a physical + virtual combo pair for one domain should collapse into a single row. But the code decides "this is a redundant combo half, hide it" from two proxies — issuedBy && isVirtual for standalone-ness, and a description-string equality for domain identity — instead of the real question: does this virtual card actually have a physical twin in the same domain? When those proxies don't hold, an active standalone virtual card is misclassified as a duplicate and dropped.

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

    Primary fix (root cause): only fold a virtual Expensify card into a domain group when a physical Expensify card of the same domainName actually exists (a genuine combo pair) — never based on whether issuedBy happens to be set. Because we already sort physical cards first, we can compute the set of domains that own a physical card up front and test against it, and match the group by the raw domainName we store on the row rather than by its display description:

    // Domains that actually have a physical Expensify card — the only cards whose virtual twin is a redundant combo half.
    const comboDomains = new Set(
        assignedCardsSorted
            .filter((card) => isExpensifyCard(card) && !!card.domainName && !card.nameValuePairs?.isVirtual)
            .map((card) => card.domainName),
    );
    // ...
    const isComboVirtualCard = !!card.nameValuePairs?.isVirtual && !!card.domainName && comboDomains.has(card.domainName);
    
    // Fold ONLY a real combo half into its existing domain row; match by domainName, not the display description.
    if (isComboVirtualCard && assignedCardsGrouped.some((item) => item.isGroupedCardDomain && item.domainName === card.domainName)) {
        // merge errors into the existing domain row …
        continue;
    }

    This requires storing domainName: card.domainName on the grouped row when it is first pushed (PaymentMethodList.tsx:364) so the merge test compares domain-to-domain.

    Why this fixes it:

    • Standalone virtual card, issuedBy unset, no physical twin → comboDomains does not contain its domain, so isComboVirtualCard is false and the card gets its own row instead of being absorbed. This is the reported case.
    • Real combo pair (physical + virtual, same domain) → the physical card (sorted first) creates the group and is added to comboDomains; the virtual twin is isComboVirtualCard and folds into the physical row — one row, exactly as intended today.
    • Admin-issued virtual card (issuedBy && isVirtual) with no physical twin → still its own row; behavior unchanged.
    • Workspace-feed domain → the merge now compares item.domainName === card.domainName instead of a policy-name-vs-domain string, so grouping is correct regardless of whether the description was rewritten to the policy name.

    Result: every active assigned Virtual Expensify Card renders its own row in the Wallet list; only a virtual card that genuinely duplicates a physical card of the same domain is collapsed into that physical card's row.

    To keep the Home "assigned cards" section consistent, the same twin-detection applies to getDisplayableExpensifyCards at CardUtils.ts:1832-1848, which uses the identical isAdminIssuedVirtualCard heuristic (seenDomains dedupe) and has the same blind spot.

    What alternative solutions did you explore? (Optional)

    • Relax isAdminIssuedVirtualCard to !!card.nameValuePairs?.isVirtual (drop the issuedBy requirement). This surfaces standalone virtual cards, but it also stops folding the virtual half of a real combo pair — every combo card would then render two rows (physical + virtual). It fixes the missing card by breaking intentional deduplication; keying on the presence of a physical twin keeps both behaviors correct.
    • Fix only the item.description === card.domainName comparison (compare against domainName). This repairs the workspace-feed fragility but leaves the issuedBy gate in place, so a plain-domain virtual card without issuedBy is still absorbed whenever any grouped row for that domain exists. It's half of the fix — necessary, but not sufficient on its own, which is why it's folded into the primary change.
    • Widen the active-state / expiry filter at PaymentMethodList.tsx:226-234. Misdirected — an active virtual card already passes ACTIVE_STATES and the expiry check; the card is dropped later at the grouping step, not at the filter. Loosening the filter would risk showing deactivated/closed cards without addressing the reported case.
  10. mukhrr commented on Jul 14, 2026

    @mukhrr
    Contributor

    Proposal

    What is the root cause of that problem?

    The Wallet groups a member's Expensify Cards by domain so the virtual half of a "combo" card folds into the physical card's row. The bug is that the code stores one value as the group key and matches on a different one.

    When a group row is created, its description is set to getDescriptionForPolicyDomainCard(card.domainName, ...), which for a workspace feed (expensify-policy<policyID>.exfy) returns the policy name, not the domain — see PolicyUtils.getDescriptionForPolicyDomainCard. But the check that decides whether the next card joins that group still compares that stored description against the raw card.domainName:

    if (assignedCardsGrouped.some((item) => item.isGroupedCardDomain && item.description === card.domainName) && !isAdminIssuedVirtualCard) {
    const domainGroupIndex = assignedCardsGrouped.findIndex((item) => item.isGroupedCardDomain && item.description === card.domainName);

    So the match only fires when the description happened to fall back to the domain name — i.e. when the policy isn't in Onyx. The same card data therefore renders differently depending on unrelated policy data, which is very likely why this is marked "Unable to reproduce":

    Policy in Onyx? Wallet shows
    No 1 row — the virtual card is absorbed and has no row
    Yes 2 rows — Expensify Card · Acme Workspace twice

    Because the group is keyed only by domain and not by what created it, the same flaw drops cards in a second case: two standalone virtual cards in one domain collapse into a single row — the first creates the group, the second is silently absorbed. I confirmed this on main in the browser: seeding two active virtual cards renders only one row.

    Git history shows this is a regression. The grouping was added in #38998 (commit 0515ffb), where the row stored description: card.domainName — so matching on item.description === card.domainName was correct. #48779 (commit 1f58e3e, "policy id shows as domain card description") then changed the stored value to the policy name but left both match conditions comparing to card.domainName. The write key and read key have been out of sync since.

    The same combo de-duplication elsewhere already does it correctly: getDisplayableExpensifyCards keys its seenDomains set on card.domainName. The Wallet list is the only place keying on a translatable, policy-dependent display string.

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

    In PaymentMethodList.tsx, key the domain group on a stable identifier, and only absorb a card into a group when that group is genuinely a physical card's row (which is what makes it a combo pair).

    Carry the raw domain and the physical flag on the row when it's pushed:

      isGroupedCardDomain: !isAdminIssuedVirtualCard,
    + cardDomainName: card.domainName,
    + hasPhysicalCard: !card?.nameValuePairs?.isVirtual,

    and match on those instead of the description:

    - if (assignedCardsGrouped.some((item) => item.isGroupedCardDomain && item.description === card.domainName) && !isAdminIssuedVirtualCard) {
    -     const domainGroupIndex = assignedCardsGrouped.findIndex((item) => item.isGroupedCardDomain && item.description === card.domainName);
    + const domainGroupIndex = assignedCardsGrouped.findIndex(
    +     (item) => item.isGroupedCardDomain && item.hasPhysicalCard && !!card.domainName && item.cardDomainName === card.domainName,
    + );
    + if (domainGroupIndex >= 0 && !isAdminIssuedVirtualCard) {

    The existing error/fraud aggregation then merges into that row exactly as today. PaymentMethodItem gains the two optional fields.

    I applied this locally and verified each case in the browser:

    Case Before After
    Combo pair (physical + virtual), policy absent 1 row 1 row
    Combo pair, policy present 2 duplicate rows 1 row
    Two standalone virtual cards, one domain 1 row (one card missing) 2 rows
    Admin-issued virtual card own row own row
    Travel card Travel CVV row Travel CVV row

    So the Wallet is deterministic, the duplicate row is gone, and standalone virtual cards no longer disappear. Combo pairs still show one row per domain — that's the existing design (getDisplayableExpensifyCards does the same, and the domain card page reveals the virtual card number), so nothing becomes unreachable. I'd add PaymentMethodList tests covering the five rows above.

    What alternative solutions did you explore? (Optional)

    • Make description stable again (store the domain instead of the policy name) so the existing comparison works.
    • Group by fundID.
  11. github-actions commented on Jul 14, 2026

    @github-actions
    Contributor

    ⚠️ @mukhrr Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  12. rafecolton commented on Jul 16, 2026

    @rafecolton
    Member

    @shubham1206agra any thoughts on the proposals so far?

  13. melvin-bot commented on Jul 16, 2026

    @melvin-bot

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

  14. Dip-G-Git commented on Jul 18, 2026

    @Dip-G-Git

    @shubham1206agra do you reviewed my proposal? can you provide feedback

  15. melvin-bot commented on Jul 20, 2026

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  16. mountiny commented on Jul 20, 2026

    @mountiny
    Contributor
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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsMelvin TriageAutomatic AI Analysis of an issueNeeds ReproductionReproducible steps needed

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions