fix: Bun.write with new Response(req.body) no longer hangs#28112
Closed
robobun wants to merge 1 commit into
Closed
fix: Bun.write with new Response(req.body) no longer hangs#28112robobun wants to merge 1 commit into
Bun.write with new Response(req.body) no longer hangs#28112robobun wants to merge 1 commit into
Claude / Claude Code Review
completed
May 12, 2026 in 20m 53s
Code review found 1 important issue
Found 5 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/runtime/webcore/FileSink.zig:68-71 |
FileSink.Options.flags() O_TRUNC change affects Bun.file().writer(), creates POSIX/Windows divergence |
Annotations
Check failure on line 71 in src/runtime/webcore/FileSink.zig
claude / Claude Code Review
FileSink.Options.flags() O_TRUNC change affects Bun.file().writer(), creates POSIX/Windows divergence
Honoring `truncate` here is correct for `pipeReadableStreamToBlob`, but `flags()` is also reached from `Bun.file(path).writer()` on POSIX (Blob.zig:3008-3019 → `sink.start()` → `setup()` → `openForWriting(..., options.flags(), ...)`), so that API now opens with `O_TRUNC` where it previously did not. The Windows `getWriter` branch (Blob.zig:~2935) still opens with `WRONLY | CREAT | NONBLOCK` and bypasses `flags()`, so this introduces a POSIX-vs-Windows divergence for `Bun.file().writer()` — worth
Loading