Skip to content

Bun.file().slice(): reject delete()/writer()/write(), fix exists(); cap chardev slice reads - #35822

Open
robobun wants to merge 5 commits into
mainfrom
claude/farm/20557d44/file-slice-read-clamp-write-reject
Open

Bun.file().slice(): reject delete()/writer()/write(), fix exists(); cap chardev slice reads#35822
robobun wants to merge 5 commits into
mainfrom
claude/farm/20557d44/file-slice-read-clamp-write-reject

Advance read_off in the POSIX ReadFile loop so chardev slices cap at …

6f06ec6
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 28, 2026 in 15m 41s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/webcore/Blob.rs:1287-1293 get_exists_sync: redundant second stat() on nonexistent un-sliced files

Annotations

Check warning on line 1293 in src/runtime/webcore/Blob.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

get_exists_sync: redundant second stat() on nonexistent un-sliced files

The new `seekable.is_none()` fallback fires even when `resolve_size()` at L1269 already ran and its `resolve_file_stat` failed (ENOENT is swallowed at L6228, leaving `seekable` still `None`). So `await Bun.file('/nonexistent').exists()` — the common pre-creation check — now issues two `stat(2)` syscalls instead of one. Correctness is unchanged; consider capturing `let did_resolve = self.size.get() == MAX_SIZE;` before L1269 and gating the fallback on `!did_resolve`, or replacing the `resolve_siz