Skip to content

FileSink: settle the pending write()'s promise in every synchronous close()/end() flush arm - #35365

Merged
Jarred-Sumner merged 4 commits into
mainfrom
farm/f1049b3d/filesink-close-orphaned-pending
Jul 24, 2026
Merged

FileSink: settle the pending write()'s promise in every synchronous close()/end() flush arm#35365
Jarred-Sumner merged 4 commits into
mainfrom
farm/f1049b3d/filesink-close-orphaned-pending

Close the class: fix end_from_js()'s Done/Wrote arms; drop the platfo…

159dbd5
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 24, 2026 in 26m 19s

Code review found 1 potential issue

Found 2 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit test/js/bun/util/filesink.test.ts:377 Dead readFdOpen guard in drained test

Annotations

Check warning on line 377 in test/js/bun/util/filesink.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Dead readFdOpen guard in drained test

Nit: `let readFdOpen = true;` is never flipped to `false` in this test — unlike the sibling 'reader gone' tests it was copied from, this one only drains `readFd` and never closes it in the try body, so the `if (readFdOpen)` guard in the finally block is vacuously true. Drop the variable and call `fs.closeSync(readFd)` unconditionally in the finally (REVIEW.md: "Every line you add must be demonstrably live"). Behavior is correct either way — `readFd` is still closed.