Large text and CSV previews fetch a 16 KB first screen before starting the worker that loads the full file. If that response stalled after its headers arrived, the worker never started and the preview stayed on "Loading file". The worker now starts once the first screen settles or after one second, and a stalled first-screen request is aborted at that point so it does not keep a browser connection busy.
Related: #25149, #45854
Reproduction on main#
Commit cc19795ea7 (main). The preview stays on Loading file. It never requests the full file. Expected: The table and row count appear from the full-file request even if the first-screen response stalls.
- Set up a connection that stalls the body of the first 16 KB range response while allowing full-file requests through.
- Open a CSV larger than 1 MB in the workspace Files panel.
The cause is at apps/web/src/components/files/LargeTextViewer.tsx:239. Ran pnpm scenarios:prove scripts/scenarios/large-csv-loads-when-its-prefix-stalls.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean boat.dev VM, with expect.toBeVisible failed in the output.
Evidence#
Environment: Linux x64 on a boat.dev VM reset before each run, the repository's own tests.
Proven: the replacement test apps/web/src/components/files/AttachmentFilePreview.browser.test.tsx fails at the test commit b07504c819 and passes on the head 4237f04f2c, both on main 3eb5894919.
| Before | After |
|---|
| Commit | b07504c819 | 4237f04f2c |
| Result | failed with "to contain '5,000 rows · 2 columns'" | passed |
| csv with a stalled prefix |  The preview stays on Loading file. It never requests the full file. |  The table and row count appear from the full-file request even if the first-screen response stalls. |
| failure |  | |
| Recording | Before: recording | After: recording |
Tests#
- b07504c819 adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 3eb58949194ce010be0af51d861d3292127e8a37 passed on head.
Not in this change#
- Mobile reads file previews through a single bounded request with no separate full-file worker, so it has no matching wait.
Who did the work#
- Repro written by GPT 6.2 Sol, in Codex
- Duplicate check judged by Claude Opus 5.5, in Claude Code
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex
- Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes