https://sonarly.com/issue/22045?type=bug The /objects/products record index page takes ~6 seconds to load due to a 494KB metadata response, a 5.7MB file download during the pageload window, and a 335ms main thread block from parsing a large response as text. Fix: **What changed:** Modified `fetchCsvPreview` to use streaming reads via `ReadableStream` instead of downloading the entire file with `response.text()`. **Why:** The original code called `response.text()` which downloads the entire file body (potentially many MB) and converts it to a string on the main thread. For a 5.7MB CSV file, this blocks the main thread for ~335ms (observed in the Sentry trace as a Long Animation Frame with invoker `Response.text.then`). The fix uses `response.body.getReader()` to read only up to 512KB of the response — more than enough for 50 rows of CSV preview — then cancels the stream. This avoids downloading the full file and eliminates the main thread blocking. **Changes:** 1. `fetchCsvPreview.ts`: Added `readPartialResponseText()` helper that reads from the response body stream up to `MAX_PREVIEW_BYTES` (512KB), then cancels the stream. Falls back to `response.text()` if the body stream is not available. 2. `fetchCsvPreview.test.ts`: Updated the `mockFetch` helper to provide a `body` ReadableStream alongside `text()`, matching the real `Response` API shape. **Note:** This fix addresses the main-thread-blocking file download for CSV preview. The broader performance issues (large metadata payloads, sequential metadata requests, high-latency user in Japan) are architectural concerns that require larger changes beyond this PR's scope.
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Why Twenty
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Jotai, Linaria and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




