From 03996eb5c1f46144074d9d3abcbcec77b6a0f0c7 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 29 Mar 2026 17:16:20 +0200 Subject: [PATCH] fix(windows): suppress modify dir events --- src/backend/Windows.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backend/Windows.zig b/src/backend/Windows.zig index d2efef8..029f5d2 100644 --- a/src/backend/Windows.zig +++ b/src/backend/Windows.zig @@ -203,6 +203,14 @@ fn thread_fn( scan_path_types_into(allocator, path_types, full_path); break :blk ot; }; + // Suppress FILE_ACTION_MODIFIED on directories: these are + // parent-directory mtime side-effects of child operations + // (delete, rename) and are not emitted by any other backend. + if (event_type == .modified and object_type == .dir) { + if (info.NextEntryOffset == 0) break; + offset += info.NextEntryOffset; + continue; + } // Capture next_entry_offset before releasing the mutex: after unlock, // the main thread may call remove_watch() which frees w.buf, making // the `info` pointer (which points into w.buf) a dangling reference.