fs: back createWriteStream(path) with a FileSink that adopts the fd - #35993
Open
robobun wants to merge 32 commits into
Open
fs: back createWriteStream(path) with a FileSink that adopts the fd#35993robobun wants to merge 32 commits into
robobun wants to merge 32 commits into
Claude / Claude Code Review
completed
Jul 26, 2026 in 17m 10s
Code review found 2 important issues
Found 1 candidates, confirmed 3. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 2 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/js/internal/fs/streams.ts:602-611 |
Monkey-patch fallback in _writev routes first batch through unpatched fs.writev |
Annotations
Check warning on line 611 in src/js/internal/fs/streams.ts
claude / Claude Code Review
Monkey-patch fallback in _writev routes first batch through unpatched fs.writev
When `syncWriteEnabled` detects a monkey-patched `fs.write` from *inside* `_writev`, it disables `_writev` for future drains but the current invocation falls through to `writevAll` → the unpatched `fs.writev`, so the first batch bypasses the patch. Pre-PR, `_writev` was unconditionally `undefined` in this branch, so buffered chunks always drained per-chunk through the patched `fs.write`. Trigger is 2+ chunks buffered before the fd opens (e.g. `ws.write(a); ws.write(b)` right after `createWriteSt
Loading