You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS watcher event-mapping: delete coalesced to Modify, rename split into Creates #5
On macOS, notify's FSEvents backend coalesces filesystem events differently than Linux's inotify:
File deletion is reported as EventKind::Modify(Any) (not Remove), so the watcher maps it to FileEvent::Modified → status Stale instead of Missing.
File rename is split into two Create events (old path empty, new path present) instead of a single Modify(Name(Both)), so the watcher fires FileEvent::Created twice instead of Renamed.
This was discovered during phase 3a CI — Linux watcher tests pass, macOS tests failed. Tests are currently gated behind #[cfg(target_os = "linux")] with a WHY comment.
Impact
On macOS, a user who deletes a file in a watched dir will see it remain Active (never flipped to Missing) until the next perima scan. Same for renames — the old path will be orphaned.
Action
Extend map_event in crates/fs/src/watcher.rs to recognize macOS-specific event patterns:
Modify(Any) on a path that no longer exists → treat as Deleted.
Two consecutive Create events where the first path is the watcher root itself → buffer and emit as Renamed if a matching Remove follows within the debounce window.
Alternative: switch to notify::PollWatcher on macOS (simpler semantics but higher CPU).
Priority
Medium — affects macOS users specifically. Worth a proper fix before the v1 release. Linux behavior is correct.
Activity
fix(phase-3a): gate watcher delete/rename tests to Linux