Skip to content

Bun.file: make exists()/size/lastModified reflect the current filesystem state - #33659

Open
robobun wants to merge 20 commits into
mainfrom
farm/1db7f535/bunfile-stat-cache
Open

Bun.file: make exists()/size/lastModified reflect the current filesystem state#33659
robobun wants to merge 20 commits into
mainfrom
farm/1db7f535/bunfile-stat-cache

get_slice: keep file store for empty regular files; drop resolve_size…

d005d65
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 28, 2026 in 18m 1s

Code review found 1 important issue

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

Details

Severity Count
🔴 Important 1
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/webcore/Blob.rs:2252-2270 get_size_for_bindings still calls resolve_size() — remaining read-poisoning sibling

Annotations

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

See this annotation in the file changed.

@claude claude / Claude Code Review

get_size_for_bindings still calls resolve_size() — remaining read-poisoning sibling

`get_size_for_bindings` (Blob.rs:2168) is the remaining sibling of the `resolve_size()` writes 7d808eaf removed: it still guards on `self.size == MAX_SIZE` and calls `self.resolve_size()`, which writes `self.size` (0 on stat failure, `st_size` on success) on the user's actual blob via `bindings.cpp:2556` (`blob->wrapped()`). So `expect(Bun.file(missing)).toHaveLength(…)` / `toBeEmpty()` poisons a later `.text()` to `""` — the #4930 shape with a test matcher in place of `.exists()`. Pre-existing,