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
[Due for payment 2026-07-21] [$250] Error displayed when importing card transactions via CSV #94178
Version Number: 9.4.15-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:@scerrato88 Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Navigate to Workspace > Company Cards.
Click Add Card.
Select a bank/card feed option.
Click Import transactions from file.
Upload a CSV file containing card transactions.
Map all required columns correctly. (The CSV columns were mapped correctly during the import flow.)
Complete the import process.
Expected Result:
The CSV should be imported successfully, or the system should provide a specific validation message identifying any issues with the file or mapped fields.
Actual Result:
The import fails and displays the generic error:
"Please ensure all fields are filled out correctly and try again. If the problem persists, please reach out to Concierge."
No additional information is provided about which field, row, or column is causing the failure.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
🚨 Edited by proposal-police: This proposal was edited at 2026-07-08 22:23:46 UTC.
Proposal
Updated 2026-07-08: Corrected based on blimpich's production-log analysis in this comment. My original proposal assumed the rejection was data-specific and required a backend fix. That was wrong: the root cause is an App-side type bug and is fully fixable here.
Please re-state the problem that we are trying to solve in this issue.
CSV company-card transaction imports fail with a generic, non-actionable error ("Please ensure all fields are filled out correctly and try again…"). The failure has nothing to do with the CSV file's contents — the request is rejected before any row is parsed.
What is the root cause of that problem?
The frontend sends instanceID as a JSON number when it should be a string, and the backend rejects any non-string instanceID before parsing the file.
This only happens when re-importing into a pre-existing feed:
The settings-page flow seeds existingInstanceID from the stored feed settings: WorkspaceCompanyCardsSettingsPage.tsx:208 — existingInstanceID: selectedFeedData?.uploadLayoutSettings?.instanceID ?? null.
For legacy feeds, that stored instanceID is a number at runtime. The type says string (CompanyCards.ts:75), but Onyx/NVP is an untyped boundary, so the real value can be numeric.
?? only substitutes on null/undefined, so a number passes straight through: CompanyCards.ts:1161 — const instanceID = existingInstanceID ?? Date.now().toString();.
JSON.stringify then emits it as a bare number in the request settings payload ("instanceID":1745351414130 instead of "instanceID":"1745351414130").
The backend reads instanceID with a string-only accessor, treats the numeric value as empty, and rejects the request as missing a required field — before any CSV row is parsed. blimpich confirmed this against production logs: all 6 of the affected account's attempts in one ~40-minute window threw the same synchronous rejection, and the downstream upload/scraper command was never reached.
Why it's not reproducible on test accounts: the Add New Card wizard has no existingInstanceID, so it falls back to Date.now().toString() — a genuine string the backend accepts. A clean test account always has a freshly-created (string) instanceID, so only legacy feeds with a stored numeric instanceID hit this. This matches the "Unable to reproduce" result and the fact that changing the CSV date format made no difference.
What changes do you think we should make in order to solve the problem?
Primary fix (App, resolves this report): coerce instanceID to a string before it is sent. Narrowest change, at CompanyCards.ts:1161:
This fixes every affected legacy feed with no data migration.
Secondary fix (App, real but not the cause here): the failure path always renders the hardcoded generic modal and discards the backend's actual error — failureData uses getImportFailedFinalModal() at CompanyCards.ts:1209 and the .catch returns the same static modal at CompanyCards.ts:1251-1256. This is why the user only ever saw the generic text. Surfacing the backend's real message would help future rejections, but on its own it would not have prevented this failure.
Optional backend hardening (outside App — escalate if desired): the backend silently treating a non-string instanceID as empty is permissive; it could be hardened to accept a numeric instanceID. The frontend coercion alone resolves the reported bug, so this is defense-in-depth only.
What changed from my original proposal & related issue
Corrected assumptions:
My original proposal pointed at ImportTransactions.ts / the IMPORT_CSV_TRANSACTIONS command. The actual re-import path is CompanyCards.ts (IMPORT_CSV_COMPANY_CARDS).
I originally concluded the real cause was server-side and required a backend engineer to escalate. Production logs show the rejection is caused by the App sending the wrong type — an App-side, one-line fix.
Proposals citing bad CSV data, missing row-level validation, or date-format handling are not relevant: the request fails before any row is parsed.
Related issue:#93704 ("CSV card feed import succeeds but no cards are created — no validation for missing required fields") is a different failure mode (import succeeds, no cards created) and is not the same root cause as this one, though both touch the CSV card-import flow.
Still to confirm (does not change the fix): why legacy feeds store a numeric instanceID in the first place — most likely feeds created via an older upload path that wrote a raw numeric timestamp. Worth checking to estimate how many customers are affected.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94178) to create a draft PR (covers the App-side coercion fix; secondary modal fix can be included). To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
🚨 Edited by proposal-police: This proposal was edited at 2026-06-22 13:55:12 UTC.
Proposal
What is the root cause of that problem?
The company‑card CSV importer does no row‑level validation of the file content and collapses every backend rejection into one hardcoded generic modal, so a file whose columns were mapped correctly but whose data the backend can't accept always surfaces the same useless message with no row/column detail.
Trace the chain:
The page only validates that the required columns are mapped and not duplicated — it never looks at the actual cell data:
importCSVCompanyCards computes transactionsCount but never guards on it — it always fires the API, even when zero valid rows were produced, and stamps the single generic getImportFailedFinalModal() into failureData (and again in .catch):
importFailedDescription: 'Please ensure all fields are filled out correctly and try again. If the problem persists, please reach out to Concierge.',
Now contrast with the sibling personal‑card importer (ImportTransactions.ts), which handles exactly this flow and has two guards the company‑card path is missing:
Empty‑result guard — if no valid rows survive parsing it returns a specificinvalidFileMessage instead of calling the API:
The company‑card builder does neither. It sends the date raw (row.at(postedDateColumnIndex)?.trim()), and the raw csvDataWithGeneratedIDs is what gets serialized to the backend:
So: a correctly‑mapped file whose date column uses a format the backend doesn't accept (e.g. dd/MM/yyyy, Nov 2, 2025, an Excel serial), or a file where every required cell is blank/un‑parseable, sails past the column‑only validate(), hits the API with un‑normalized data, the backend bounces it, and failureData paints the one generic message — with no indication of which field/row/column failed. That matches "columns were mapped correctly during import, yet import fails with the generic error and no specifics" exactly.
So: column‑only validate() → no empty/date guard in importCSVCompanyCards → raw data sent → backend rejects → single hardcoded getImportFailedFinalModal() → user sees the generic, detail‑free error.
What changes do you think we should make in order to solve the problem?
Bring the company‑card importer to parity with the personal‑card importer by reusing the patterns already in ImportTransactions.ts — no new infrastructure needed.
Normalize dates in the builder. In buildOptimisticCompanyCardCSVTransactions, run the posted date through the existing parseCSVDate (already exported from @libs/CSVDateUtils, used by the personal flow) and write the normalized value back into the row that gets serialized, skipping rows whose date can't be parsed — mirroring
and to row[postedDateColumnIndex] so the backend receives a canonical yyyy-MM-dd.
Add the empty‑result guard. In importCSVCompanyCards, after building transactions, short‑circuit when nothing valid was produced instead of calling the API — reusing the personal‑flow guard verbatim:
'The file you uploaded is either empty or contains invalid data. Please ensure that the file is correctly formatted and contains the necessary information before uploading it again.',
.
Surface the backend's actual reason. The deeper UX gap is that failureData always stamps the fixed getImportFailedFinalModal() and discards whatever specific message the ImportCSVCompanyCards command returned. Read the server response message in the .catch/failure path and pass it through as the modal promptKey/prompt when present, falling back to the generic copy only when it isn't — so "which field/row failed" actually reaches the user. This touches
(1) and (2) are pure reuse of ImportTransactions.ts and immediately fix the structurally‑invalid‑but‑mapped case; (3) closes the "no detail" complaint for backend‑side rejections. Minor changes/improvements can be discussed in the PR phase.
What alternative solutions did you explore? (Optional)
Replicate the personal‑card date parsing/empty guard directly inside CompanyCardsImportedPage's validate() so the Import button blocks before any request. This gives earlier feedback, but validate() runs on every render and would re‑parse the whole sheet repeatedly, and it duplicates logic that already lives in the action layer. Keeping validation in importCSVCompanyCards (where the transactions are already built) reuses the exact sibling pattern, runs once per submit, and keeps the page lean.
🚨 Edited by proposal-police: This proposal was edited at 2026-06-22 13:44:55 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Importing card transactions from a CSV (Workspace > Company Cards > Add Card > Import from file) fails with the generic "Please ensure all fields are filled out correctly…" error, with no indication of which field, row, or column is at fault.
What is the root cause of that problem?
The Company Cards import path skips the client-side validation its sibling Wallet path performs, then hard-codes a generic failure message — so bad input reaches the server and the user gets no specifics.
buildOptimisticCompanyCardCSVTransactions silently drops every row missing a required value (cardName/created/currency/amount):
This explains all symptoms: it fails despite correct column mapping (the data fails per-value validation), shows generic copy, names no row/field, and is "unable to reproduce" since it depends on the CSV's date/amount/currency formatting.
What changes do you think we should make in order to solve the problem?
In importCSVCompanyCards, port the Wallet path's guard and surface the real error:
And in .catch((error) => …) (and failureData), pass the backend's returned message instead of always getImportFailedFinalModal(). Regression safety: the guard only changes the all-rows-invalid case (today a guaranteed failure); valid imports are untouched.
What alternative solutions did you explore? (Optional)
Only reword importFailedDescription copy — incomplete: still generic, still fires a doomed request, still names no row/field.
Only add the empty-guard — misses BE per-value rejections (e.g. unsupported currency) where >0 rows parse but the server still rejects; surfacing the BE message covers those too.
changed the title [-]Error displayed when importing card transactions via CSV[/-][+][$250] Error displayed when importing card transactions via CSV[/+]on Jun 22, 2026
The local evidence matches this recurring failure shape: NewDot and OldDot read different default account/card fields. Here, src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:94 and src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:90 do not agree on the same CSV value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.
What changes do you think we should make in order to solve the problem?
Update src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:94 to derive CSV from the card/accounting data source that owns this flow before the value is consumed.
Carry the same normalized value through src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:90; that follows the safer family move to add fallback at the export/mapping layer, so the write/optimistic/read paths agree instead of only changing the visible component.
Keep the change inside the Payments, Wallet, Bank, Billing, Cards surface and avoid changing money movement, bank/card/account settings.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add or update a regression in tests/unit/Payment*.ts for the exact issue flow: Error displayed when importing card transactions via CSV.
Cover the counter-case near src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:94 so valid existing CSV behavior still works.
Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.
What alternative solutions did you explore? (Optional)
I would not add a broad new condition outside these referenced paths; the safer fix is to keep CSV consistent at the first read/write boundary shown above.
⚠️@yusufdeveloper2903 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
The company-card CSV importer only validates that the required columns are mapped — it never validates the values in those columns. validate() checks for missing/duplicate column roles and nothing else:
When the rows are turned into transactions, any row whose required cell is bad (empty card number, empty currency, or an amount that parseCSVAmount can't turn into a number) is silently continued and produces no optimistic transaction:
But the full, unfilteredcsvData is still sent to the backend. So a CSV that is "mapped correctly" but contains an unparseable amount / blank currency / unrecognized date in some row passes the client check, the backend rejects the whole batch, and the catch path falls back to the generic failure modal:
importFailedDescription: 'Please ensure all fields are filled out correctly and try again. If the problem persists, please reach out to Concierge.',
So: client validates column mapping but not cell values → bad rows are dropped locally yet still forwarded → backend rejects everything → user gets the generic "ensure all fields are filled out correctly" with no row/field detail. This also explains "unable to reproduce" — it only happens with specific cell contents.
What changes do you think we should make in order to solve the problem?
Validate the cell values before calling the API, at the shared point that already inspects each row — buildOptimisticCompanyCardCSVTransactions:
Instead of silently skipping a row that has the required columns but invalid data, collect the offending row index and reason (e.g. "amount in row 5 isn't a number", "currency missing in row 7"). Return that alongside the transactions, and in importTransactions surface a specific error through the existing errors/final-modal channel rather than calling the backend. This keeps the optimistic data and the data sent to the backend in agreement, and tells the user exactly which row/field to fix.
What alternative solutions did you explore? (Optional)
Add the same value checks directly in the page's validate() so the "Import" button blocks with a per-field message before submission. Functionally equivalent, but doing it in buildOptimisticCompanyCardCSVTransactions fixes it at the single point that already parses every cell and is shared by the import call.
Activity
MelvinBot commentedon Jun 22, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-08 22:23:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
CSV company-card transaction imports fail with a generic, non-actionable error ("Please ensure all fields are filled out correctly and try again…"). The failure has nothing to do with the CSV file's contents — the request is rejected before any row is parsed.
What is the root cause of that problem?
The frontend sends
instanceIDas a JSON number when it should be a string, and the backend rejects any non-stringinstanceIDbefore parsing the file.This only happens when re-importing into a pre-existing feed:
existingInstanceIDfrom the stored feed settings:WorkspaceCompanyCardsSettingsPage.tsx:208—existingInstanceID: selectedFeedData?.uploadLayoutSettings?.instanceID ?? null.instanceIDis a number at runtime. The type saysstring(CompanyCards.ts:75), but Onyx/NVP is an untyped boundary, so the real value can be numeric.??only substitutes onnull/undefined, so a number passes straight through:CompanyCards.ts:1161—const instanceID = existingInstanceID ?? Date.now().toString();.JSON.stringifythen emits it as a bare number in the requestsettingspayload ("instanceID":1745351414130instead of"instanceID":"1745351414130").instanceIDwith a string-only accessor, treats the numeric value as empty, and rejects the request as missing a required field — before any CSV row is parsed.blimpichconfirmed this against production logs: all 6 of the affected account's attempts in one ~40-minute window threw the same synchronous rejection, and the downstream upload/scraper command was never reached.Why it's not reproducible on test accounts: the Add New Card wizard has no
existingInstanceID, so it falls back toDate.now().toString()— a genuine string the backend accepts. A clean test account always has a freshly-created (string)instanceID, so only legacy feeds with a stored numericinstanceIDhit this. This matches the "Unable to reproduce" result and the fact that changing the CSV date format made no difference.What changes do you think we should make in order to solve the problem?
Primary fix (App, resolves this report): coerce
instanceIDto a string before it is sent. Narrowest change, atCompanyCards.ts:1161:This fixes every affected legacy feed with no data migration.
Secondary fix (App, real but not the cause here): the failure path always renders the hardcoded generic modal and discards the backend's actual error —
failureDatausesgetImportFailedFinalModal()atCompanyCards.ts:1209and the.catchreturns the same static modal atCompanyCards.ts:1251-1256. This is why the user only ever saw the generic text. Surfacing the backend's real message would help future rejections, but on its own it would not have prevented this failure.Optional backend hardening (outside App — escalate if desired): the backend silently treating a non-string
instanceIDas empty is permissive; it could be hardened to accept a numericinstanceID. The frontend coercion alone resolves the reported bug, so this is defense-in-depth only.What changed from my original proposal & related issue
Corrected assumptions:
ImportTransactions.ts/ theIMPORT_CSV_TRANSACTIONScommand. The actual re-import path isCompanyCards.ts(IMPORT_CSV_COMPANY_CARDS).Related issue: #93704 ("CSV card feed import succeeds but no cards are created — no validation for missing required fields") is a different failure mode (import succeeds, no cards created) and is not the same root cause as this one, though both touch the CSV card-import flow.
Still to confirm (does not change the fix): why legacy feeds store a numeric
instanceIDin the first place — most likely feeds created via an older upload path that wrote a raw numeric timestamp. Worth checking to estimate how many customers are affected.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94178)to create a draft PR (covers the App-side coercion fix; secondary modal fix can be included).To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
yusufdeveloper2903 commentedon Jun 22, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-06-22 13:55:12 UTC.
Proposal
What is the root cause of that problem?
The company‑card CSV importer does no row‑level validation of the file content and collapses every backend rejection into one hardcoded generic modal, so a file whose columns were mapped correctly but whose data the backend can't accept always surfaces the same useless message with no row/column detail.
Trace the chain:
The page only validates that the required columns are mapped and not duplicated — it never looks at the actual cell data:
App/src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx
Lines 81 to 100 in 2b78b56
It then hands the raw rows to
importCSVCompanyCardsunconditionally:App/src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx
Lines 138 to 149 in 2b78b56
importCSVCompanyCardscomputestransactionsCountbut never guards on it — it always fires the API, even when zero valid rows were produced, and stamps the single genericgetImportFailedFinalModal()intofailureData(and again in.catch):App/src/libs/actions/CompanyCards.ts
Lines 1146 to 1176 in 2b78b56
App/src/libs/actions/CompanyCards.ts
Lines 1217 to 1222 in 2b78b56
That generic modal is the exact "Please ensure all fields are filled out correctly… reach out to Concierge." string the reporter saw:
App/src/libs/actions/ImportSpreadsheet.ts
Lines 82 to 87 in 2b78b56
App/src/languages/en.ts
Lines 1198 to 1199 in 2b78b56
Now contrast with the sibling personal‑card importer (
ImportTransactions.ts), which handles exactly this flow and has two guards the company‑card path is missing:Empty‑result guard — if no valid rows survive parsing it returns a specific
invalidFileMessageinstead of calling the API:App/src/libs/actions/ImportTransactions.ts
Lines 256 to 263 in 2b78b56
Date normalization — every date is normalized to
yyyy-MM-ddviaparseCSVDate, and rows with unparseable dates are skipped:App/src/libs/actions/ImportTransactions.ts
Lines 154 to 160 in 2b78b56
The company‑card builder does neither. It sends the date raw (
row.at(postedDateColumnIndex)?.trim()), and the rawcsvDataWithGeneratedIDsis what gets serialized to the backend:App/src/libs/actions/CompanyCards.ts
Lines 116 to 153 in 2b78b56
App/src/libs/actions/CompanyCards.ts
Lines 1126 to 1138 in 2b78b56
So: a correctly‑mapped file whose date column uses a format the backend doesn't accept (e.g.
dd/MM/yyyy,Nov 2, 2025, an Excel serial), or a file where every required cell is blank/un‑parseable, sails past the column‑onlyvalidate(), hits the API with un‑normalized data, the backend bounces it, andfailureDatapaints the one generic message — with no indication of which field/row/column failed. That matches "columns were mapped correctly during import, yet import fails with the generic error and no specifics" exactly.So: column‑only
validate()→ no empty/date guard inimportCSVCompanyCards→ raw data sent → backend rejects → single hardcodedgetImportFailedFinalModal()→ user sees the generic, detail‑free error.What changes do you think we should make in order to solve the problem?
Bring the company‑card importer to parity with the personal‑card importer by reusing the patterns already in
ImportTransactions.ts— no new infrastructure needed.Normalize dates in the builder. In
buildOptimisticCompanyCardCSVTransactions, run the posted date through the existingparseCSVDate(already exported from@libs/CSVDateUtils, used by the personal flow) and write the normalized value back into the row that gets serialized, skipping rows whose date can't be parsed — mirroringApp/src/libs/actions/ImportTransactions.ts
Lines 154 to 160 in 2b78b56
createdvalue atApp/src/libs/actions/CompanyCards.ts
Lines 121 to 130 in 2b78b56
row[postedDateColumnIndex]so the backend receives a canonicalyyyy-MM-dd.Add the empty‑result guard. In
importCSVCompanyCards, after building transactions, short‑circuit when nothing valid was produced instead of calling the API — reusing the personal‑flow guard verbatim:placed right after
buildOptimisticCompanyCardCSVTransactionsatApp/src/libs/actions/CompanyCards.ts
Line 1126 in 2b78b56
invalidFileMessagealready exists atApp/src/languages/en.ts
Lines 1202 to 1203 in 2b78b56
failureDataalways stamps the fixedgetImportFailedFinalModal()and discards whatever specificmessagetheImportCSVCompanyCardscommand returned. Read the server response message in the.catch/failure path and pass it through as the modalpromptKey/prompt when present, falling back to the generic copy only when it isn't — so "which field/row failed" actually reaches the user. This touchesApp/src/libs/actions/CompanyCards.ts
Lines 1167 to 1222 in 2b78b56
(1) and (2) are pure reuse of
ImportTransactions.tsand immediately fix the structurally‑invalid‑but‑mapped case; (3) closes the "no detail" complaint for backend‑side rejections. Minor changes/improvements can be discussed in the PR phase.What alternative solutions did you explore? (Optional)
Replicate the personal‑card date parsing/empty guard directly inside
CompanyCardsImportedPage'svalidate()so the Import button blocks before any request. This gives earlier feedback, butvalidate()runs on every render and would re‑parse the whole sheet repeatedly, and it duplicates logic that already lives in the action layer. Keeping validation inimportCSVCompanyCards(where the transactions are already built) reuses the exact sibling pattern, runs once per submit, and keeps the page lean.ahmdshrif commentedon Jun 22, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-06-22 13:44:55 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Importing card transactions from a CSV (Workspace > Company Cards > Add Card > Import from file) fails with the generic "Please ensure all fields are filled out correctly…" error, with no indication of which field, row, or column is at fault.
What is the root cause of that problem?
The Company Cards import path skips the client-side validation its sibling Wallet path performs, then hard-codes a generic failure message — so bad input reaches the server and the user gets no specifics.
buildOptimisticCompanyCardCSVTransactionssilently drops every row missing a required value (cardName/created/currency/amount):App/src/libs/actions/CompanyCards.ts
Lines 128 to 130 in 256ad45
importCSVCompanyCardshas no empty-list guard — it firesAPI.writeeven when 0 valid transactions were built:App/src/libs/actions/CompanyCards.ts
Lines 1126 to 1138 in 256ad45
App/src/libs/actions/ImportTransactions.ts
Lines 258 to 262 in 256ad45
failureDataand.catchsubstitute the hard-coded generic modal, discarding the backend's validation message:App/src/libs/actions/CompanyCards.ts
Line 1175 in 256ad45
App/src/libs/actions/CompanyCards.ts
Lines 1217 to 1222 in 256ad45
This explains all symptoms: it fails despite correct column mapping (the data fails per-value validation), shows generic copy, names no row/field, and is "unable to reproduce" since it depends on the CSV's date/amount/currency formatting.
What changes do you think we should make in order to solve the problem?
In
importCSVCompanyCards, port the Wallet path's guard and surface the real error:And in
.catch((error) => …)(andfailureData), pass the backend's returned message instead of alwaysgetImportFailedFinalModal(). Regression safety: the guard only changes the all-rows-invalid case (today a guaranteed failure); valid imports are untouched.What alternative solutions did you explore? (Optional)
importFailedDescriptioncopy — incomplete: still generic, still fires a doomed request, still names no row/field.melvin-bot commentedon Jun 22, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cretadn22 (
External)[-]Error displayed when importing card transactions via CSV[/-][+][$250] Error displayed when importing card transactions via CSV[/+]melvin-bot commentedon Jun 22, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022069053620673593010
godzillaxbox19982014-lgtm commentedon Jun 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Error displayed when importing card transactions via CSV
What is the root cause of that problem?
I traced this to the path that handles
CSV:translate):errors.duplicates = translate('workspace.companyCards.addNewCard.csvErrors.duplicateColumns', duplicate);translate):errors.required = translate('workspace.companyCards.addNewCard.csvErrors.requiredColumns', missingRequiredColumns);columnMappings):const columnMappings = columnNames.map((_, index) => columnNamesByIndex.at(index) ?? CONST.CSV_IMPORT_COLUMNS.IGNORE);src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:94andsrc/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:90do not agree on the sameCSVvalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.What changes do you think we should make in order to solve the problem?
src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:94to deriveCSVfrom the card/accounting data source that owns this flow before the value is consumed.src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:90; that follows the safer family move to add fallback at the export/mapping layer, so the write/optimistic/read paths agree instead of only changing the visible component.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/Payment*.tsfor the exact issue flow: Error displayed when importing card transactions via CSV.src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx:94so valid existingCSVbehavior still works.What alternative solutions did you explore? (Optional)
CSVconsistent at the first read/write boundary shown above.github-actions commentedon Jun 22, 2026
lorretheboy commentedon Jun 22, 2026
Proposal
What is the root cause of that problem?
The company-card CSV importer only validates that the required columns are mapped — it never validates the values in those columns.
validate()checks for missing/duplicate column roles and nothing else:App/src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx
Lines 81 to 100 in 256ad45
When the rows are turned into transactions, any row whose required cell is bad (empty card number, empty currency, or an amount that
parseCSVAmountcan't turn into a number) is silentlycontinued and produces no optimistic transaction:App/src/libs/actions/CompanyCards.ts
Lines 128 to 130 in 256ad45
But the full, unfiltered
csvDatais still sent to the backend. So a CSV that is "mapped correctly" but contains an unparseable amount / blank currency / unrecognized date in some row passes the client check, the backend rejects the whole batch, and the catch path falls back to the generic failure modal:App/src/libs/actions/CompanyCards.ts
Lines 1217 to 1222 in 256ad45
which is the message the reporter saw:
App/src/languages/en.ts
Lines 1198 to 1199 in 256ad45
So: client validates column mapping but not cell values → bad rows are dropped locally yet still forwarded → backend rejects everything → user gets the generic "ensure all fields are filled out correctly" with no row/field detail. This also explains "unable to reproduce" — it only happens with specific cell contents.
What changes do you think we should make in order to solve the problem?
Validate the cell values before calling the API, at the shared point that already inspects each row —
buildOptimisticCompanyCardCSVTransactions:App/src/libs/actions/CompanyCards.ts
Lines 116 to 150 in 256ad45
Instead of silently skipping a row that has the required columns but invalid data, collect the offending row index and reason (e.g. "amount in row 5 isn't a number", "currency missing in row 7"). Return that alongside the transactions, and in
importTransactionssurface a specific error through the existingerrors/final-modal channel rather than calling the backend. This keeps the optimistic data and the data sent to the backend in agreement, and tells the user exactly which row/field to fix.What alternative solutions did you explore? (Optional)
Add the same value checks directly in the page's
validate()so the "Import" button blocks with a per-field message before submission. Functionally equivalent, but doing it inbuildOptimisticCompanyCardCSVTransactionsfixes it at the single point that already parses every cell and is shared by the import call.72 remaining items
melvin-bot commentedon Jul 20, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 20, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
cretadn22 commentedon Jul 22, 2026
I don't think we need the checklist for this issue. The bug is an edge case that is only reproducible on the client side
melvin-bot commentedon Jul 23, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Jul 23, 2026
Payment Summary
Contributor+: @cretadn22 due $250 via NewDot
JmillsExpensify commentedon Jul 24, 2026
$250 approved for @cretadn22