Bug Report template
Repro steps, expected vs actual, environment. Open it in the editor, replace what needs replacing, and export a typeset PDF — free, no signup, nothing uploaded.
Preview
BUG-2291 — CSV export truncates at 10,000 rows
| Severity | P2 — data loss, workaround exists |
| Reported by | Support (3 customer tickets) |
| Affects | 1.8.2 and later · web only |
| Assigned | Omar Haddad |
Summary
Exporting a report with more than 10,000 rows produces a CSV containing exactly 10,000 data rows. No warning is shown and the file downloads normally, so users believe the export is complete.
Steps to reproduce
- Sign in to an account with at least 12,000 events in the last 30 days.
- Open Reports → Events, set the range to Last 30 days.
- Click Export → CSV.
- Open the downloaded file and count the rows.
Expected
All matching rows are exported, or the user is told the export was capped.
Actual
The file contains a header plus exactly 10,000 rows. The UI reports success.
Notes
The reporting query still carries the default LIMIT 10000 from the paginated
endpoint it was copied from. It was never lifted for the export path.
```ts // src/server/reports/export.ts const rows = await db.events.findMany({ where: range, take: 10_000, // <- paginated default, wrong for a full export }) ```
Workaround
Export in two narrower date ranges and concatenate the files.
Fix
Stream the export with a cursor instead of a single bounded query, and add a regression test that exports 25,000 rows and asserts the count.
The Markdown source
---
skin: technical
accent: #dc2626
title: 'BUG-2291: CSV export truncates at 10,000 rows'
---
# BUG-2291 — CSV export truncates at 10,000 rows
| | |
| :-- | :-- |
| **Severity** | P2 — data loss, workaround exists |
| **Reported by** | Support (3 customer tickets) |
| **Affects** | 1.8.2 and later · web only |
| **Assigned** | Omar Haddad |
## Summary
Exporting a report with more than 10,000 rows produces a CSV containing exactly
10,000 data rows. No warning is shown and the file downloads normally, so users
believe the export is complete.
## Steps to reproduce
1. Sign in to an account with at least 12,000 events in the last 30 days.
2. Open **Reports → Events**, set the range to *Last 30 days*.
3. Click **Export → CSV**.
4. Open the downloaded file and count the rows.
## Expected
All matching rows are exported, or the user is told the export was capped.
## Actual
The file contains a header plus exactly 10,000 rows. The UI reports success.
## Notes
The reporting query still carries the default `LIMIT 10000` from the paginated
endpoint it was copied from. It was never lifted for the export path.
\`\`\`ts
// src/server/reports/export.ts
const rows = await db.events.findMany({
where: range,
take: 10_000, // <- paginated default, wrong for a full export
})
\`\`\`
## Workaround
Export in two narrower date ranges and concatenate the files.
## Fix
Stream the export with a cursor instead of a single bounded query, and add a
regression test that exports 25,000 rows and asserts the count.
Copy it anywhere Markdown works — or open it pre-loaded in Scripto with the button above.
Related templates
Ship your bug report today.
One click opens this template in the editor with a live paginated preview.