Turbopack: don't treat events as relevant because their parent dir is in the watcher batch (#99782)
## Summary On macOS, frequent writes to an untracked file kept the watcher batch open and delayed the invalidation of tracked files until the writes stopped. This made the native cases of `irrelevant_events_do_not_delay_invalidation` fail consistently (took ~3.3s, i.e. the whole churn). Why: FSEvents keeps the `ItemCreated` flag set on a recently created file, so each write to an existing file shows up as a `Create(File)` event. When a tracked file in the same directory changed, `mark_parent_dir` added that directory to the batch, even though nothing had listed it. The fast path in `is_relevant` then treated every later `Create` of a sibling as relevant because its parent was in the batch, and each of those events pushed the batch deadline back. The fast path now only checks the path itself. The slow path still checks the parent against `dir_invalidator_map`, so events under a directory whose listing is tracked still count as relevant. ## Verification - `cargo test -p turbo-tasks-fs --lib watcher::` on macOS: all 19 tests pass, including `repeated_writes_to_tracked_file_are_debounced`. Before this change, the two native `irrelevant_events_do_not_delay_invalidation` cases failed.🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- NEXT_JS_LLM --> --------- Co-authored-by:Benjamin Woodruff <benjamin.woodruff@vercel.com>
Showing
Please
register
or
sign in
to comment