CSV export drops rows after a comma inside a quoted field
Reporter: Arjun Mehta · Date: 2026-05-19
Summary
Exporting the orders table to CSV silently drops every row that follows an order note containing a comma.
Environment
| Field | Value |
|---|---|
| Version/commit | web 4.12.0 (a91f3c2) |
| OS / browser | macOS 15.4, Chrome 136; also reproduced on Firefox 138 |
| Environment (prod/staging/local) | Production, Marlowe Goods workspace |
Steps to reproduce
- Open Orders and filter to May 2026 (412 orders)
- Edit order #10388 and set the note to
Leave at door, ring twice - Click Export, CSV
- Open the file in any spreadsheet tool and count the rows
Expected
412 data rows, with the note kept intact in one column.
Actual
The file has 187 data rows. The export stops at the row before #10388 with no error in the UI.
Evidence
2026-05-19T09:42:11Z ERROR export-worker job=exp_77a1 rows_written=187
CsvWriteError: unterminated quoted field at line 188
at writeRow (export/csv.ts:64)
The support ticket (SUP-3120) includes the customer's truncated file.
Severity & impact
Severity 2. Every workspace with a comma in any order note is affected; support has 6 tickets this week. Reproduces every time. Customers are reconciling invoices against incomplete files without knowing it.
Workaround
Export as XLSX instead, which uses a different writer and keeps all rows. Support has a macro with this advice.
Suspected cause
Commit a91f3c2 replaced the CSV library with a hand-written writeRow that quotes fields containing newlines but not commas, and the worker treats the first write error as end of stream.