You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$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
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:
Sign in to New Expensify with an account that has one or more active Virtual Expensify Cards.
Navigate to Settings > Wallet.
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:
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):
constisAdminIssuedVirtualCard=!!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.constcomboDomains=newSet(assignedCardsSorted.filter((card)=>isExpensifyCard(card)&&!!card.domainName&&!card.nameValuePairs?.isVirtual).map((card)=>card.domainName),);// ...constisComboVirtualCard=!!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.
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:
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 Workspacetwice
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:
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.
⚠️@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.
Activity
exfy-zapier commentedon Jul 13, 2026
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
MelvinBot commentedon Jul 13, 2026
Run details
MelvinBot commentedon Jul 13, 2026
Run details
MelvinBot commentedon Jul 13, 2026
Run details
MelvinBot commentedon Jul 13, 2026
Run details
16 remaining items
yusufdeveloper2903 commentedon Jul 13, 2026
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
PaymentMethodListwithshouldShowAssignedCardsat 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 —
getAssignedCardSortKeyreturns0for physical,1for 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 andcontinue-skipped — it gets no row of its own (PaymentMethodList.tsx:341-355):The only escape hatch that lets a virtual card keep its own row is
isAdminIssuedVirtualCard, and that flag is true only when bothnameValuePairs.issuedByandnameValuePairs.isVirtualare set. This is where legitimate virtual cards fall through:issuedByrequirement is too strict. A virtual Expensify card that is active but whosenameValuePairs.issuedByis not populated (virtual cards issued through flows that don't stampissuedBy) fails theisAdminIssuedVirtualCardtest. If any other card of the samedomainNamewas 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.item.description === card.domainName, but the grouped row'sdescriptionwas set viagetDescriptionForPolicyDomainCard(card.domainName, …)(PaymentMethodList.tsx:360-363), which for a workspace feed returns the policy name, not the rawdomainName(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
isAdminIssuedVirtualCardescape hatch were both introduced in PR #38998 (commit0515ffbd7da, "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 && isVirtualfor 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
domainNameactually exists (a genuine combo pair) — never based on whetherissuedByhappens 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 rawdomainNamewe store on the row rather than by its display description:This requires storing
domainName: card.domainNameon the grouped row when it is first pushed (PaymentMethodList.tsx:364) so the merge test compares domain-to-domain.Why this fixes it:
issuedByunset, no physical twin →comboDomainsdoes not contain its domain, soisComboVirtualCardisfalseand the card gets its own row instead of being absorbed. This is the reported case.comboDomains; the virtual twin isisComboVirtualCardand folds into the physical row — one row, exactly as intended today.issuedBy && isVirtual) with no physical twin → still its own row; behavior unchanged.item.domainName === card.domainNameinstead 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
getDisplayableExpensifyCardsat CardUtils.ts:1832-1848, which uses the identicalisAdminIssuedVirtualCardheuristic (seenDomainsdedupe) and has the same blind spot.What alternative solutions did you explore? (Optional)
isAdminIssuedVirtualCardto!!card.nameValuePairs?.isVirtual(drop theissuedByrequirement). 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.item.description === card.domainNamecomparison (compare againstdomainName). This repairs the workspace-feed fragility but leaves theissuedBygate in place, so a plain-domain virtual card withoutissuedByis 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.ACTIVE_STATESand 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.mukhrr commentedon Jul 14, 2026
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
descriptionis set togetDescriptionForPolicyDomainCard(card.domainName, ...), which for a workspace feed (expensify-policy<policyID>.exfy) returns the policy name, not the domain — seePolicyUtils.getDescriptionForPolicyDomainCard. But the check that decides whether the next card joins that group still compares that stored description against the rawcard.domainName:App/src/pages/settings/Wallet/PaymentMethodList.tsx
Lines 341 to 342 in d8ec440
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":
Expensify Card · Acme WorkspacetwiceBecause 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
mainin 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 storeddescription: card.domainName— so matching onitem.description === card.domainNamewas correct. #48779 (commit1f58e3e, "policy id shows as domain card description") then changed the stored value to the policy name but left both match conditions comparing tocard.domainName. The write key and read key have been out of sync since.The same combo de-duplication elsewhere already does it correctly:
getDisplayableExpensifyCardskeys itsseenDomainsset oncard.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:
and match on those instead of the description:
The existing error/fraud aggregation then merges into that row exactly as today.
PaymentMethodItemgains the two optional fields.I applied this locally and verified each case in the browser:
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 (
getDisplayableExpensifyCardsdoes the same, and the domain card page reveals the virtual card number), so nothing becomes unreachable. I'd addPaymentMethodListtests covering the five rows above.What alternative solutions did you explore? (Optional)
descriptionstable again (store the domain instead of the policy name) so the existing comparison works.fundID.github-actions commentedon Jul 14, 2026
rafecolton commentedon Jul 16, 2026
@shubham1206agra any thoughts on the proposals so far?
melvin-bot commentedon Jul 16, 2026
@shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!
shubham1206agra commentedon Jul 18, 2026
Asked for help here https://expensify.slack.com/archives/C049HHMV9SM/p1784383853711239?thread_ts=1783715280.642979&cid=C049HHMV9SM
Dip-G-Git commentedon Jul 18, 2026
@shubham1206agra do you reviewed my proposal? can you provide feedback
melvin-bot commentedon Jul 20, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
mountiny commentedon Jul 20, 2026
Discussed in Slack https://expensify.slack.com/archives/C049HHMV9SM/p1783715280642979 closing for now