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
[$175] Card statements displays the same cards and transactions regardless of the selected CSV feed. #105907
Version Number: 9.5.27-2 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:@nicollyrodrigues-max Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Access a customer account with multiple company card feeds whose transactions are imported monthly through CSV uploads in Expensify Classic.
In New Expensify, navigate to Spend > Card statements.
Keep the Posted filter set to Last statement.
Open the Feed filter, select only one CSV feed, such as CHASE VISA/SMC (Pete R), and click Apply.
Review the displayed cards, expense count, and total spend.
Reopen the Feed filter, deselect the previous feed, select a different CSV feed, such as AMEX SMC (Don), and click Apply.
Compare the results.
Expected Result:
The results should display only the cards and transactions associated with the selected feed and posted period. The expense count and total spend should reflect those filtered results.
Actual Result:
The same card list and transactions remain visible after applying different CSV feed selections. The results continue to show same expenses and total spend, preventing the customer from reconciling each feed separately.
The CSV feeds have distinct names in the filter dropdown, but the corresponding rows display the generic label “CSV cards” in the Feed column.
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 video and screenshot for the issue are in Slack thread
Blocked on dev NewDot web: the supplied account has no workspaces or expenses, so the required multiple Classic-imported company-card CSV feeds are unavailable. No data was invented.
Step
Status
1. Access account with multiple Classic-imported CSV feedsWorkspaces displays “No workspaces yet” and prompts creation of a workspace to manage company cards.
❌
2. Navigate Spend > Card statementsSpend displays Expenses and Reports with “No expenses yet”; Card statements is not available.
❌
3. Keep Posted set to Last statementBlocked by the missing CSV-feed fixture; Posted could not be verified.
❌
4. Select only one CSV feed and ApplyBlocked by the missing CSV-feed fixture; no feed was selected or applied.
❌
5. Inspect cards, expense count, and totalBlocked by the missing CSV-feed fixture; selected-feed results could not be inspected.
❌
6. Replace selection with a different CSV feed and ApplyBlocked by the missing CSV-feed fixture; a second feed was unavailable.
❌
7. Verify selected-feed isolation, appropriate total changes, and Feed column labelsBlocked by the missing CSV-feed fixture; cards, transactions, totals, and Feed labels could not be compared.
⚠️Preliminary analysis (low confidence) — the root cause remains unconfirmed.
Hypothesis: Search may return identical results for distinct CSV-feed selections. The inspected App code does not support an identifier-collision explanation.
CardUtils.ts:1097–1116 uses fallback labels when custom names do not resolve. Generic labels do not prove merged filters.
An unchanged outgoing query or stale displayed results remain alternatives.
The checkout is newer than reported version 9.5.27-2. Web reproduction was blocked by missing CSV feeds.
To confirm: Compare both selections’ Search requests and responses: feed values, hashes, cards, counts, and totals. Repeat with explicit Posted dates. Different requests with identical responses warrant internal investigation; unchanged requests point toward App selection state. No code fix is justified yet.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Card statements displays the same cards and transactions regardless of the selected CSV feed.[/-][+][$175] Card statements displays the same cards and transactions regardless of the selected CSV feed.[/+]on Nov 4, 2026
There are two distinct issues causing the generic "CSV cards" label in the Feed column and the unfiltered card/transaction results when switching between CSV feeds:
Why the Feed column displays "CSV cards" while the Feed filter dropdown shows distinct feed names:
In src/libs/CardUtils.ts (getCustomOrFormattedFeedName), the string "CSV cards" is only produced when getBankName(feed) returns CONST.COMPANY_CARDS.CARD_TYPE.CSV ("CSV"), translate('workspace.companyCards.feedName', 'CSV') formats it with the " cards" suffix, and customFeedName is undefined.
customFeedName resolves to undefined in getCardSections (src/libs/SearchUIUtils.ts:3499-3514) because:
CSV upload feeds store their user-defined layout name in settings.companyCards[feed].uploadLayoutSettings.layoutName (which getCombinedCardFeedsFromAllFeeds in src/libs/CardFeedUtils.ts:609 already falls back to via customFeedName ?? feedSettings?.uploadLayoutSettings?.layoutName), whereas getCardSections (src/libs/SearchUIUtils.ts:3506), getCustomFeedNameFromFeeds (src/libs/CardUtils.ts:128), and getCardFeedsForDisplay (src/libs/CardFeedUtils.ts:267) only check settings.companyCardNicknames?.[feed] and ignore uploadLayoutSettings?.layoutName.
In getCardSections, card is looked up from cardList (ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST). For CSV feeds, unassigned/imported cards are not preloaded into PERSONAL_AND_WORKSPACE_CARD_LIST on initial search load (and CSV cards can lack card.fundID, as noted in the comment at src/libs/SearchUIUtils.ts:3497). When card?.fundID is undefined, getCardSections passes customFeedName = undefined and the generic cardGroup.bank value to getFeedNameForDisplay, which fails to match the numbered CSV feed key (ccupload1, ccupload2, csv1, etc.) and falls back to "CSV cards".
Why selecting different CSV feeds returns the same cards, expense count, and total spend:
Multiple CSV feeds imported under the same domain have distinct feed keys (<fundID>_<feedKey>) in sharedNVP_private_domain_member_<fundID>.settings.companyCards, but their underlying card rows share the same generic CSV bank identifier (upload / csv) on the domain.
When feed:"<fundID>_<feedKey>" is applied on Spend > Card statements (group-by:card posted:last-statement), neither the search query resolution nor getCardSections scopes the results to the specific card IDs belonging to that CSV feed layout (cards_<fundID>_<feedKey>), so every CSV feed selection on the same domain matches the full set of CSV cards and transactions for that domain.
What changes do you think we should make in order to solve the problem?
Include uploadLayoutSettings?.layoutName in feed display-name resolution:
In getCustomFeedNameFromFeeds (src/libs/CardUtils.ts), getCardFeedsForDisplay / getCardFeedsForDisplayPerPolicy / getVisibleCompanyCardFeedsForSelector (src/libs/CardFeedUtils.ts), and getCardSections (src/libs/SearchUIUtils.ts), fall back to feedData?.settings?.companyCards?.[feed]?.uploadLayoutSettings?.layoutName when companyCardNicknames?.[feed] is not set, matching the existing pattern in getCombinedCardFeedsFromAllFeeds (src/libs/CardFeedUtils.ts:609).
Resolve the specific CSV feed key and domain in getCardSections (src/libs/SearchUIUtils.ts):
Look up the card across both cardList and nonPersonalAndWorkspaceCardList, resolve its feed key via getCompanyCardFeed(card.bank) when present, and when card?.fundID is missing on a CSV card group, fall back to getCustomFeedNameFromFeeds (or the active feed filter in queryJSON when a single CSV feed is selected) so the Feed column displays the specific CSV feed name instead of "CSV cards".
Scope CSV feed filtering to the selected feed's cards:
When filtering by a CSV upload feed (isCSVUploadFeed), resolve the feed key to its associated cards (cards_<fundID>_<feedKey> / feed layout mapping in Search) so that selecting a specific CSV feed filters the returned card statement groups, transaction counts, and total spend to only that CSV feed.
What alternative solutions did you explore? (Optional)
We considered filtering cardSections purely client-side in getCardSections based on queryJSON.flatFilters for the feed key, but client-side row filtering alone would leave the search snapshot's footer totals and pagination counts out of sync with the visible rows unless the query/backend feed resolution also scopes by the selected CSV feed's cards.
Please re-state the problem that we are trying to solve in this issue.
On Spend > Card statements, when filtering by different CSV company card feeds (e.g. switching between CHASE VISA/SMC (Pete R) and AMEX SMC (Don) under the Feed filter), the results continue displaying the exact same list of cards, expense counts, and total spend. Furthermore, despite distinct feed names appearing in the filter dropdown, the Feed column on each statement row displays the generic fallback "CSV cards".
What is the root cause of that problem?
There are two root causes in feed display name resolution and CSV feed filtering:
Generic "CSV cards" label in the Feed column (src/libs/SearchUIUtils.ts:3505-3518 & src/libs/CardUtils.ts:1145-1192):
In src/libs/SearchUIUtils.ts:3505-3518, statement card sections build formattedFeedName via getFeedNameForDisplay:
For CSV feeds, the custom user-defined feed name is stored in feedSettings?.uploadLayoutSettings?.layoutName (as recognized in src/libs/CardFeedUtils.ts:609: customFeedName: customFeedName ?? feedSettings?.uploadLayoutSettings?.layoutName).
However, getFeedNameForDisplay and getCustomFeedNameFromFeeds (src/libs/CardUtils.ts:1145-1158) exclusively inspect feedData?.settings?.companyCardNicknames?.[feed] and completely ignore uploadLayoutSettings?.layoutName.
Furthermore, in getCardSections, card?.fundID is often undefined for imported CSV card groups (as noted at SearchUIUtils.ts:3497), so customFeedName passes as undefined. getFeedNameForDisplay then falls back to getCustomOrFormattedFeedName(translate, feed, undefined, true), which resolves feed (ccupload* or generic upload/csv) to the fallback "CSV cards".
Selecting different CSV feeds does not filter the returned cards or transactions:
Multiple CSV feeds imported under the same domain have distinct feed IDs (${fundID}_${feedName}) in the filter dropdown, but their card records share the same underlying bank type (upload / csv).
When the user selects a specific CSV feed, the filter sets feed:"<fundID>_<feedName>". However, search query resolution does not restrict the card rows to the specific cards belonging to that CSV feed layout (cards_<fundID>_<feedName>), causing every CSV feed selection on that domain to return the full set of cards and transactions.
What changes do you think we should make in order to solve the problem?
In src/libs/CardUtils.ts (getCustomFeedNameFromFeeds):
Support uploadLayoutSettings?.layoutName when resolving custom feed names from cardFeeds, matching getCombinedCardFeedsFromAllFeeds in CardFeedUtils.ts:609:
--- a/src/libs/CardUtils.ts+++ b/src/libs/CardUtils.ts@@ -1152,7 +1152,8 @@ function getCustomFeedNameFromFeeds(cardFeeds: OnyxCollection<CardFeeds> | unde
for (const feedData of Object.values(cardFeeds)) {
- const nickname = feedData?.settings?.companyCardNicknames?.[feed];+ const feedSettings = feedData?.settings?.companyCards?.[feed];+ const nickname = feedData?.settings?.companyCardNicknames?.[feed] ?? feedSettings?.uploadLayoutSettings?.layoutName;
if (nickname) {
return nickname;
}
}
In src/libs/CardFeedUtils.ts (getCardFeedsForDisplay & getCardFeedsForDisplayPerPolicy):
In both getCardFeedsForDisplay (line 257) and getCardFeedsForDisplayPerPolicy (line 390), fallback to feedData?.settings?.uploadLayoutSettings?.layoutName when companyCardNicknames?.[feed] is not set:
In src/libs/SearchUIUtils.ts (getCardSections):
When card?.fundID is missing on a CSV card group, retrieve customFeedName using getCustomFeedNameFromFeeds(cardFeeds, cardGroup.bank as OnyxTypes.CompanyCardFeed) (or from the active feed filter in transactionsQueryJSON) so the specific CSV feed name (e.g. CHASE VISA/SMC (Pete R) cards) is displayed instead of the generic "CSV cards".
Scope CSV feed query filtering:
Ensure feed filter resolution maps CSV upload feeds (isCSVUploadFeed) to their specific card IDs (cards_${fundID}_${feedName}) so that selecting an individual CSV feed isolates transactions and cards belonging solely to that feed.
What alternative solutions did you explore? (Optional)
Only renaming the feed in the UI without scoping transactions: rejected because customers need to reconcile individual CSV feeds separately as described in the issue.
What automated tests can you add to prevent this from re-occurring?
In tests/unit/CardUtilsTest.ts:
Verify getCustomFeedNameFromFeeds returns uploadLayoutSettings.layoutName for CSV company card feeds when no manual nickname is set.
Verify getFeedNameForDisplay returns the layout name with " cards" suffix for CSV feeds.
Yes—but there are two separate fixtures needed: feed/card data for the dropdown, and Search responses for the statement rows and totals. Adding feeds to Onyx alone won’t reproduce the filtering issue.
The earlier run was blocked by an empty account, not a confirmed reproduction.
1. Populate two local CSV feeds
Use a disposable local-development account with an existing paid workspace, not a customer account. Web development exposes Onyx in DevTools (documentation).
This supplies two distinct feed identities: 900000001_csv1 and 900000001_csv2. The selector constructs those IDs separately from their labels (CardFeedUtils.ts:244–265).
2. Supply statement results separately
For a frontend-only test, intercept each selection’s Search response and return different snapshots:
Selected feed
Returned card
Expense count
Total
Monthly A
910000001
1
$10
Monthly B
910000002
2
$25
Use the existing card-group Search fixture as the response template. Its data contains personalDetailsList and group_<cardID> entries with bank, cardID, count, total, and currency.
Each response must target snapshot_<that request’s actual hash>, with matching search.hash and totals. Capture the hash from the outgoing request rather than inventing it (Search.ts:1451–1506). Online responses can overwrite manually seeded snapshots.
What this verifies—and what it doesn’t
Mocked responses: verify A → B → A sends distinct feed values and renders the corresponding cards/counts/totals.
Actual reported bug: requires two real Classic CSV feeds with disjoint cards and imported transactions in the selected posted period. Compare their real Search requests and responses.
Returning the same mocked data for both feeds would manufacture the symptom, not confirm the bug.
This is a source-based fixture recipe; I haven’t executed it in the browser, and the production root cause remains unconfirmed.
Please re-state the problem that we are trying to solve in this issue.
On Spend > Card statements (type:expense group-by:card posted:last-statement), when a customer has multiple company card feeds imported via CSV uploads in Expensify Classic:
Even when the Feed filter dropdown shows distinct CSV feed names (e.g. CHASE VISA/SMC (Pete R) and AMEX SMC (Don)), every statement row displays the generic fallback label "CSV cards" in the Feed column.
Selecting different CSV feeds in the Feed filter and clicking Apply displays the same list of cards, expense counts, and total spend, preventing the customer from reconciling each CSV feed separately.
What is the root cause of that problem?
There are two connected root causes across Expensify/App's feed display/selector utilities and CSV feed card-statement resolution:
Defect A (uploadLayoutSettings.layoutName ignored outside getCombinedCardFeedsFromAllFeeds): For CSV upload feeds (ccupload* / csv*), the feed's layout name is stored at settings.companyCards[feed].uploadLayoutSettings.layoutName—which getCombinedCardFeedsFromAllFeeds in src/libs/CardFeedUtils.ts:605 already reads via customFeedName: customFeedName ?? feedSettings?.uploadLayoutSettings?.layoutName. However, getCustomFeedNameFromFeeds (src/libs/CardUtils.ts:1140-1153), getCardSections (src/libs/SearchUIUtils.ts:3660-3664), getCardFeedsForDisplay (CardFeedUtils.ts:263), getCardFeedsForDisplayPerPolicy (CardFeedUtils.ts:393), and getVisibleCompanyCardFeedsForSelector (CardFeedUtils.ts:508) only check settings?.companyCardNicknames?.[feed] and ignore settings?.companyCards?.[feed]?.uploadLayoutSettings?.layoutName.
Defect B (card lookup and cardGroup.bank normalization in getCardSections): In getCardSections, card is only read from cardList (ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST), not nonPersonalAndWorkspaceCardList, and as the comment at line 3643 notes, workspace/company cards from a feed can lack card.fundID or not be present in cardList. Furthermore, cardGroup.bank on statement group rows can carry either a domain suffix (#domainID) or the generic CSV bank value (upload / csv) rather than the numbered feed key (csv1, csv2, ccupload1). When getFeedNameForDisplay calls getCustomFeedNameFromFeeds(cardFeeds, cardGroup.bank), it fails to match the specific CSV feed's custom/layout name and falls back to getCustomOrFormattedFeedName(translate, feed, undefined, true), which maps getBankName(feed) === 'CSV' to translate('workspace.companyCards.feedName', 'CSV') = "CSV cards".
Why selecting different CSV feeds on the same domain returns the same cards and transactions:
Multiple Classic CSV feeds under the same fundID have distinct feed filter keys (${fundID}_${feed}, e.g. 12345_csv1 and 12345_csv2) in getCardFeedsForDisplay (CardFeedUtils.ts:253), while their imported card records share the same underlying CSV bank identifier on that domain.
When the user selects a specific CSV feed in the Feed filter (feed:"<fundID>_<feed>"), getCardSections (src/libs/SearchUIUtils.ts:3598-3675) and the Search query resolution do not scope the CSV feed filter to the cards belonging to that specific CSV feed layout (cards_<fundID>_<feed>), so both CSV feed selections return the full set of CSV cards and transactions for that domain.
What changes do you think we should make in order to solve the problem?
In getCustomFeedNameFromFeeds (src/libs/CardUtils.ts:1140-1153), normalize const feedKey = getCompanyCardFeed(feed as CardFeedWithNumber) and fall back to uploadLayoutSettings?.layoutName:
Apply the same cardFeeds?.settings?.companyCardNicknames?.[feed] ?? cardFeeds?.settings?.companyCards?.[feed]?.uploadLayoutSettings?.layoutName fallback in getCardFeedsForDisplay (CardFeedUtils.ts:263), getCardFeedsForDisplayPerPolicy (CardFeedUtils.ts:393), and getVisibleCompanyCardFeedsForSelector (CardFeedUtils.ts:508), matching getCombinedCardFeedsFromAllFeeds (CardFeedUtils.ts:605).
Resolve the card from both cardList and nonPersonalAndWorkspaceCardList and resolve its feed key/custom name in getCardSections (src/libs/SearchUIUtils.ts:3642-3667):
Look up const card = cardList?.[cardGroup.cardID] ?? nonPersonalAndWorkspaceCardList?.[cardGroup.cardID];.
Resolve const feedKey = getCompanyCardFeed((card?.bank ?? cardGroup.bank) as OnyxTypes.CompanyCardFeed);.
Look up customFeedName from domainSettings?.companyCardNicknames?.[feedKey] ?? domainSettings?.companyCards?.[feedKey]?.uploadLayoutSettings?.layoutName (and when a single CSV feed is filtered in queryJSON for a generic CSV cardGroup.bank, resolve its feed key from the active feed filter) so the Feed column displays the specific CSV feed name (e.g. CHASE VISA/SMC (Pete R) cards) instead of "CSV cards".
Scope CSV feed filtering to the selected feed's cards:
Ensure the feed filter for CSV upload feeds (isCSVUploadFeed) resolves to the cards associated with that specific CSV feed (cards_${fundID}_${feed} / layout mapping) so that switching between CSV feeds isolates the displayed cards, transaction counts, and total spend for each feed.
What alternative solutions did you explore? (Optional)
Filtering cardSections only on the client in getCardSections: Rejected because filtering rows client-side after the Search response arrives would leave the statement footer's total spend and expense count out of sync with the visible rows whenever the backend returns all domain CSV cards.
I've been trying to reproduce this locally, but no luck so far. If I'm still unable to reproduce it today, I'll ask in the #contributor-plus channel if someone else can reproduce it and take it up.
I was able to reproduce this on dev with two NewDot CSV feeds on the same workspace. The feeds are ccupload1 (Feed A) and ccupload2 (Feed B), on fund 22353296.
Steps
Go to Workspace → Company cards → Add cards → Import transactions from file. Import feedA_chase_oct.csv with name “Feed A”, then assign the cards.
Repeat as a new feed with feedB_amex_oct.csv and layout name “Feed B”.
Go to Spend → Card statements and keep Posted set to Last statement. Select Feed A, then Feed B.
Result
The App sends distinct queries for each selection:
The Search response is identical for both. Both contain group_1706838286791432 (•1111) and group_6805067643766166 (•1112), and both groups have "bank": "ccupload1". So the ccupload2 filter returns ccupload1 cards, and Feed B’s cards (•2222, •2223) never appear.
The frontend passes the selected feed through unchanged and doesn’t filter grouped results on the client. This looks like a backend Search API issue with how CSV (ccupload*) feeds are matched.
For backend context, I’d start with JS00001—the original Posted-filter PR explicitly routed backend filtering problems to him. I couldn’t verify the original Auth implementation author with the repository access available here.
@arosiclair@jayeshmangwani this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Activity
MelvinBot commentedon Nov 4, 2026
🤖 Web test steps verification results:⚠️ partial
Blocked on dev NewDot web: the supplied account has no workspaces or expenses, so the required multiple Classic-imported company-card CSV feeds are unavailable. No data was invented.
1. Access account with multiple Classic-imported CSV feeds
Workspaces displays “No workspaces yet” and prompts creation of a workspace to manage company cards.2. Navigate Spend > Card statements
Spend displays Expenses and Reports with “No expenses yet”; Card statements is not available.3. Keep Posted set to Last statement
Blocked by the missing CSV-feed fixture; Posted could not be verified.4. Select only one CSV feed and Apply
Blocked by the missing CSV-feed fixture; no feed was selected or applied.5. Inspect cards, expense count, and total
Blocked by the missing CSV-feed fixture; selected-feed results could not be inspected.6. Replace selection with a different CSV feed and Apply
Blocked by the missing CSV-feed fixture; a second feed was unavailable.7. Verify selected-feed isolation, appropriate total changes, and Feed column labels
Blocked by the missing CSV-feed fixture; cards, transactions, totals, and Feed labels could not be compared.view run
MelvinBot commentedon Nov 4, 2026
Hypothesis: Search may return identical results for distinct CSV-feed selections. The inspected App code does not support an identifier-collision explanation.
Evidence and alternatives
The checkout is newer than reported version 9.5.27-2. Web reproduction was blocked by missing CSV feeds.
To confirm: Compare both selections’ Search requests and responses: feed values, hashes, cards, counts, and totals. Repeat with explicit Posted dates. Different requests with identical responses warrant internal investigation; unchanged requests point toward App selection state. No code fix is justified yet.
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.view run · no recording available
melvin-bot commentedon Nov 4, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)[-]Card statements displays the same cards and transactions regardless of the selected CSV feed.[/-][+][$175] Card statements displays the same cards and transactions regardless of the selected CSV feed.[/+]melvin-bot commentedon Nov 4, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022117973447745311673
jaharoni commentedon Nov 4, 2026
Proposal
What is the root cause of that problem?
There are two distinct issues causing the generic
"CSV cards"label in the Feed column and the unfiltered card/transaction results when switching between CSV feeds:Why the Feed column displays
"CSV cards"while the Feed filter dropdown shows distinct feed names:src/libs/CardUtils.ts(getCustomOrFormattedFeedName), the string"CSV cards"is only produced whengetBankName(feed)returnsCONST.COMPANY_CARDS.CARD_TYPE.CSV("CSV"),translate('workspace.companyCards.feedName', 'CSV')formats it with the" cards"suffix, andcustomFeedNameisundefined.customFeedNameresolves toundefinedingetCardSections(src/libs/SearchUIUtils.ts:3499-3514) because:settings.companyCards[feed].uploadLayoutSettings.layoutName(whichgetCombinedCardFeedsFromAllFeedsinsrc/libs/CardFeedUtils.ts:609already falls back to viacustomFeedName ?? feedSettings?.uploadLayoutSettings?.layoutName), whereasgetCardSections(src/libs/SearchUIUtils.ts:3506),getCustomFeedNameFromFeeds(src/libs/CardUtils.ts:128), andgetCardFeedsForDisplay(src/libs/CardFeedUtils.ts:267) only checksettings.companyCardNicknames?.[feed]and ignoreuploadLayoutSettings?.layoutName.getCardSections,cardis looked up fromcardList(ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST). For CSV feeds, unassigned/imported cards are not preloaded intoPERSONAL_AND_WORKSPACE_CARD_LISTon initial search load (and CSV cards can lackcard.fundID, as noted in the comment atsrc/libs/SearchUIUtils.ts:3497). Whencard?.fundIDisundefined,getCardSectionspassescustomFeedName = undefinedand the genericcardGroup.bankvalue togetFeedNameForDisplay, which fails to match the numbered CSV feed key (ccupload1,ccupload2,csv1, etc.) and falls back to"CSV cards".Why selecting different CSV feeds returns the same cards, expense count, and total spend:
<fundID>_<feedKey>) insharedNVP_private_domain_member_<fundID>.settings.companyCards, but their underlying card rows share the same generic CSV bank identifier (upload/csv) on the domain.feed:"<fundID>_<feedKey>"is applied on Spend > Card statements (group-by:card posted:last-statement), neither the search query resolution norgetCardSectionsscopes the results to the specific card IDs belonging to that CSV feed layout (cards_<fundID>_<feedKey>), so every CSV feed selection on the same domain matches the full set of CSV cards and transactions for that domain.What changes do you think we should make in order to solve the problem?
Include
uploadLayoutSettings?.layoutNamein feed display-name resolution:getCustomFeedNameFromFeeds(src/libs/CardUtils.ts),getCardFeedsForDisplay/getCardFeedsForDisplayPerPolicy/getVisibleCompanyCardFeedsForSelector(src/libs/CardFeedUtils.ts), andgetCardSections(src/libs/SearchUIUtils.ts), fall back tofeedData?.settings?.companyCards?.[feed]?.uploadLayoutSettings?.layoutNamewhencompanyCardNicknames?.[feed]is not set, matching the existing pattern ingetCombinedCardFeedsFromAllFeeds(src/libs/CardFeedUtils.ts:609).Resolve the specific CSV feed key and domain in
getCardSections(src/libs/SearchUIUtils.ts):cardListandnonPersonalAndWorkspaceCardList, resolve its feed key viagetCompanyCardFeed(card.bank)when present, and whencard?.fundIDis missing on a CSV card group, fall back togetCustomFeedNameFromFeeds(or the activefeedfilter inqueryJSONwhen a single CSV feed is selected) so the Feed column displays the specific CSV feed name instead of"CSV cards".Scope CSV feed filtering to the selected feed's cards:
isCSVUploadFeed), resolve the feed key to its associated cards (cards_<fundID>_<feedKey>/ feed layout mapping in Search) so that selecting a specific CSV feed filters the returned card statement groups, transaction counts, and total spend to only that CSV feed.What alternative solutions did you explore? (Optional)
We considered filtering
cardSectionspurely client-side ingetCardSectionsbased onqueryJSON.flatFiltersfor thefeedkey, but client-side row filtering alone would leave the search snapshot's footer totals and pagination counts out of sync with the visible rows unless the query/backend feed resolution also scopes by the selected CSV feed's cards.Contributor details
Your Expensify account email: jaharoni@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/inceptionenginesystems
melvin-bot commentedon Nov 4, 2026
jaharoni commentedon Nov 4, 2026
Contributor details
Your Expensify account email: jaharoni@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/inceptionenginesystems
melvin-bot commentedon Nov 4, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Enes2553 commentedon Nov 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Spend > Card statements, when filtering by different CSV company card feeds (e.g. switching between
CHASE VISA/SMC (Pete R)andAMEX SMC (Don)under the Feed filter), the results continue displaying the exact same list of cards, expense counts, and total spend. Furthermore, despite distinct feed names appearing in the filter dropdown, the Feed column on each statement row displays the generic fallback"CSV cards".What is the root cause of that problem?
There are two root causes in feed display name resolution and CSV feed filtering:
Generic
"CSV cards"label in the Feed column (src/libs/SearchUIUtils.ts:3505-3518&src/libs/CardUtils.ts:1145-1192):In
src/libs/SearchUIUtils.ts:3505-3518, statement card sections buildformattedFeedNameviagetFeedNameForDisplay:feedSettings?.uploadLayoutSettings?.layoutName(as recognized insrc/libs/CardFeedUtils.ts:609:customFeedName: customFeedName ?? feedSettings?.uploadLayoutSettings?.layoutName).getFeedNameForDisplayandgetCustomFeedNameFromFeeds(src/libs/CardUtils.ts:1145-1158) exclusively inspectfeedData?.settings?.companyCardNicknames?.[feed]and completely ignoreuploadLayoutSettings?.layoutName.getCardSections,card?.fundIDis oftenundefinedfor imported CSV card groups (as noted atSearchUIUtils.ts:3497), socustomFeedNamepasses asundefined.getFeedNameForDisplaythen falls back togetCustomOrFormattedFeedName(translate, feed, undefined, true), which resolvesfeed(ccupload*or genericupload/csv) to the fallback"CSV cards".Selecting different CSV feeds does not filter the returned cards or transactions:
${fundID}_${feedName}) in the filter dropdown, but their card records share the same underlying bank type (upload/csv).feed:"<fundID>_<feedName>". However, search query resolution does not restrict the card rows to the specific cards belonging to that CSV feed layout (cards_<fundID>_<feedName>), causing every CSV feed selection on that domain to return the full set of cards and transactions.What changes do you think we should make in order to solve the problem?
In
src/libs/CardUtils.ts(getCustomFeedNameFromFeeds):Support
uploadLayoutSettings?.layoutNamewhen resolving custom feed names fromcardFeeds, matchinggetCombinedCardFeedsFromAllFeedsinCardFeedUtils.ts:609:In
src/libs/CardFeedUtils.ts(getCardFeedsForDisplay&getCardFeedsForDisplayPerPolicy):In both
getCardFeedsForDisplay(line 257) andgetCardFeedsForDisplayPerPolicy(line 390), fallback tofeedData?.settings?.uploadLayoutSettings?.layoutNamewhencompanyCardNicknames?.[feed]is not set:In
src/libs/SearchUIUtils.ts(getCardSections):When
card?.fundIDis missing on a CSV card group, retrievecustomFeedNameusinggetCustomFeedNameFromFeeds(cardFeeds, cardGroup.bank as OnyxTypes.CompanyCardFeed)(or from the active feed filter intransactionsQueryJSON) so the specific CSV feed name (e.g.CHASE VISA/SMC (Pete R) cards) is displayed instead of the generic"CSV cards".Scope CSV feed query filtering:
Ensure
feedfilter resolution maps CSV upload feeds (isCSVUploadFeed) to their specific card IDs (cards_${fundID}_${feedName}) so that selecting an individual CSV feed isolates transactions and cards belonging solely to that feed.What alternative solutions did you explore? (Optional)
What automated tests can you add to prevent this from re-occurring?
In
tests/unit/CardUtilsTest.ts:getCustomFeedNameFromFeedsreturnsuploadLayoutSettings.layoutNamefor CSV company card feeds when no manual nickname is set.getFeedNameForDisplayreturns the layout name with" cards"suffix for CSV feeds.12 remaining items
MelvinBot commentedon Nov 12, 2026
Yes—but there are two separate fixtures needed: feed/card data for the dropdown, and Search responses for the statement rows and totals. Adding feeds to Onyx alone won’t reproduce the filtering issue.
The earlier run was blocked by an empty account, not a confirmed reproduction.
1. Populate two local CSV feeds
Use a disposable local-development account with an existing paid workspace, not a customer account. Web development exposes
Onyxin DevTools (documentation).Replace the two placeholders, then run:
This supplies two distinct feed identities:
900000001_csv1and900000001_csv2. The selector constructs those IDs separately from their labels (CardFeedUtils.ts:244–265).2. Supply statement results separately
For a frontend-only test, intercept each selection’s Search response and return different snapshots:
910000001910000002Use the existing card-group Search fixture as the response template. Its
datacontainspersonalDetailsListandgroup_<cardID>entries withbank,cardID,count,total, andcurrency.Each response must target
snapshot_<that request’s actual hash>, with matchingsearch.hashand totals. Capture the hash from the outgoing request rather than inventing it (Search.ts:1451–1506). Online responses can overwrite manually seeded snapshots.What this verifies—and what it doesn’t
This is a source-based fixture recipe; I haven’t executed it in the browser, and the production root cause remains unconfirmed.
view run
cocvn157 commentedon Nov 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Spend > Card statements (
type:expense group-by:card posted:last-statement), when a customer has multiple company card feeds imported via CSV uploads in Expensify Classic:CHASE VISA/SMC (Pete R)andAMEX SMC (Don)), every statement row displays the generic fallback label "CSV cards" in the Feed column.What is the root cause of that problem?
There are two connected root causes across
Expensify/App's feed display/selector utilities and CSV feed card-statement resolution:Why the Feed column displays
"CSV cards"(and why CSV feeds without a manual nickname entry fall back to"CSV") insrc/libs/SearchUIUtils.ts:3642-3667,src/libs/CardUtils.ts:1140-1186, andsrc/libs/CardFeedUtils.ts:263, 393, 508:getCardSections(src/libs/SearchUIUtils.ts:3642-3667), each card group row looks upcardand formatsformattedFeedNameas:uploadLayoutSettings.layoutNameignored outsidegetCombinedCardFeedsFromAllFeeds): For CSV upload feeds (ccupload*/csv*), the feed's layout name is stored atsettings.companyCards[feed].uploadLayoutSettings.layoutName—whichgetCombinedCardFeedsFromAllFeedsinsrc/libs/CardFeedUtils.ts:605already reads viacustomFeedName: customFeedName ?? feedSettings?.uploadLayoutSettings?.layoutName. However,getCustomFeedNameFromFeeds(src/libs/CardUtils.ts:1140-1153),getCardSections(src/libs/SearchUIUtils.ts:3660-3664),getCardFeedsForDisplay(CardFeedUtils.ts:263),getCardFeedsForDisplayPerPolicy(CardFeedUtils.ts:393), andgetVisibleCompanyCardFeedsForSelector(CardFeedUtils.ts:508) only checksettings?.companyCardNicknames?.[feed]and ignoresettings?.companyCards?.[feed]?.uploadLayoutSettings?.layoutName.cardlookup andcardGroup.banknormalization ingetCardSections): IngetCardSections,cardis only read fromcardList(ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST), notnonPersonalAndWorkspaceCardList, and as the comment at line3643notes, workspace/company cards from a feed can lackcard.fundIDor not be present incardList. Furthermore,cardGroup.bankon statement group rows can carry either a domain suffix (#domainID) or the generic CSV bank value (upload/csv) rather than the numbered feed key (csv1,csv2,ccupload1). WhengetFeedNameForDisplaycallsgetCustomFeedNameFromFeeds(cardFeeds, cardGroup.bank), it fails to match the specific CSV feed's custom/layout name and falls back togetCustomOrFormattedFeedName(translate, feed, undefined, true), which mapsgetBankName(feed) === 'CSV'totranslate('workspace.companyCards.feedName', 'CSV')="CSV cards".Why selecting different CSV feeds on the same domain returns the same cards and transactions:
fundIDhave distinct feed filter keys (${fundID}_${feed}, e.g.12345_csv1and12345_csv2) ingetCardFeedsForDisplay(CardFeedUtils.ts:253), while their imported card records share the same underlying CSV bank identifier on that domain.feed:"<fundID>_<feed>"),getCardSections(src/libs/SearchUIUtils.ts:3598-3675) and theSearchquery resolution do not scope the CSV feed filter to the cards belonging to that specific CSV feed layout (cards_<fundID>_<feed>), so both CSV feed selections return the full set of CSV cards and transactions for that domain.What changes do you think we should make in order to solve the problem?
Include
uploadLayoutSettings?.layoutNamewhen resolving custom feed names insrc/libs/CardUtils.ts:1140-1153andsrc/libs/CardFeedUtils.ts:263, 393, 508:getCustomFeedNameFromFeeds(src/libs/CardUtils.ts:1140-1153), normalizeconst feedKey = getCompanyCardFeed(feed as CardFeedWithNumber)and fall back touploadLayoutSettings?.layoutName:cardFeeds?.settings?.companyCardNicknames?.[feed] ?? cardFeeds?.settings?.companyCards?.[feed]?.uploadLayoutSettings?.layoutNamefallback ingetCardFeedsForDisplay(CardFeedUtils.ts:263),getCardFeedsForDisplayPerPolicy(CardFeedUtils.ts:393), andgetVisibleCompanyCardFeedsForSelector(CardFeedUtils.ts:508), matchinggetCombinedCardFeedsFromAllFeeds(CardFeedUtils.ts:605).Resolve the card from both
cardListandnonPersonalAndWorkspaceCardListand resolve its feed key/custom name ingetCardSections(src/libs/SearchUIUtils.ts:3642-3667):const card = cardList?.[cardGroup.cardID] ?? nonPersonalAndWorkspaceCardList?.[cardGroup.cardID];.const feedKey = getCompanyCardFeed((card?.bank ?? cardGroup.bank) as OnyxTypes.CompanyCardFeed);.customFeedNamefromdomainSettings?.companyCardNicknames?.[feedKey] ?? domainSettings?.companyCards?.[feedKey]?.uploadLayoutSettings?.layoutName(and when a single CSV feed is filtered inqueryJSONfor a generic CSVcardGroup.bank, resolve its feed key from the activefeedfilter) so the Feed column displays the specific CSV feed name (e.g.CHASE VISA/SMC (Pete R) cards) instead of"CSV cards".Scope CSV feed filtering to the selected feed's cards:
feedfilter for CSV upload feeds (isCSVUploadFeed) resolves to the cards associated with that specific CSV feed (cards_${fundID}_${feed}/ layout mapping) so that switching between CSV feeds isolates the displayed cards, transaction counts, and total spend for each feed.What alternative solutions did you explore? (Optional)
cardSectionsonly on the client ingetCardSections: Rejected because filtering rows client-side after theSearchresponse arrives would leave the statement footer's total spend and expense count out of sync with the visible rows whenever the backend returns all domain CSV cards.jayeshmangwani commentedon Nov 16, 2026
I've been trying to reproduce this locally, but no luck so far. If I'm still unable to reproduce it today, I'll ask in the #contributor-plus channel if someone else can reproduce it and take it up.
jayeshmangwani commentedon Nov 17, 2026
I was able to reproduce this on dev with two NewDot CSV feeds on the same workspace. The feeds are
ccupload1(Feed A) andccupload2(Feed B), on fund 22353296.Steps
feedA_chase_oct.csvwith name “Feed A”, then assign the cards.feedB_amex_oct.csvand layout name “Feed B”.Result
The App sends distinct queries for each selection:
feed:22353296_ccupload1 posted:last-statement(hash2087499993)feed:22353296_ccupload2 posted:last-statement(hash879581818)The Search response is identical for both. Both contain
group_1706838286791432(•1111) andgroup_6805067643766166(•1112), and both groups have"bank": "ccupload1". So theccupload2filter returnsccupload1cards, and Feed B’s cards (•2222, •2223) never appear.The frontend passes the selected feed through unchanged and doesn’t filter grouped results on the client. This looks like a backend Search API issue with how CSV (
ccupload*) feeds are matched.feedA_chase_oct.csv
feedB_amex_oct.csv
jayeshmangwani commentedon Nov 17, 2026
I think we need someone from the BE team to look into this, as the issue appears to be coming from the backend. context #105907 (comment).
🎀 👀 🎀 C+ reviewed
expensify-chore-bot commentedon Nov 17, 2026
Triggered auto assignment to @arosiclair, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
arosiclair commentedon Nov 18, 2026
@MelvinBot who worked on the
feedandposted:last-statementsearch queries originally?MelvinBot commentedon Nov 18, 2026
The original App implementation was by Abdelhafidh Belalia (
s77rt), with Jack Senyitko (JS00001) and Carlos Martins (luacmartins) reviewing:feed:— Search: AddFeedfilter, merged July 7, 2025.posted:last-statement— AddPostedfilter, merged July 10, 2025.<fundID>_<feed>identities — alsos77rt: Suggested search: Prefix feed id values with fund id.For backend context, I’d start with
JS00001—the original Posted-filter PR explicitly routed backend filtering problems to him. I couldn’t verify the original Auth implementation author with the repository access available here.view run
expensify-chore-bot commentedon Nov 18, 2026
@arosiclair @jayeshmangwani this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
jayeshmangwani commentedon Nov 19, 2026
Not overdue. We're still looking for someone from the BE team to investigate this.