Skip to content

fix(csv-parser): strip leading UTF-8 BOM before parsing batch CSVs (closes #1031) - #1070

Open
jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:fix/issue-1031-strip-utf8-bom
Open

jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:fix/issue-1031-strip-utf8-bom

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown
Contributor

Summary

Closes #1031

This PR resolves issue #1031 where CSV files saved by spreadsheet tools like Excel ("CSV UTF-8") include a leading Byte Order Mark (\uFEFF), causing the first column header to be parsed as \uFEFFrecipient and triggering an unmapped/missing required column error.

Changes

  • lib/csv-parser.ts: Strip a leading \uFEFF from csvText before splitting into lines in parseCsvBatch.
  • __tests__/lib/csv-parser.test.ts: Added unit test verifying that a CSV batch payload with a leading UTF-8 BOM parses identically to one without a BOM.

Verification

  • All 27 unit tests in __tests__/lib/csv-parser.test.ts pass (npx vitest run csv-parser).
  • Cleanly mergeable with upstream main.

This branch had an error being deployed

1 failed deployment
staging — 25cf2cf0 Deployed Oct 24, 2026 by jdjioe5-cpu via deploy-staging #363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strip the UTF-8 BOM before parsing batch CSV files

1 participant