From b8106354b0c43aa059f6a77e7c5ccb09ef415af9 Mon Sep 17 00:00:00 2001 From: astrid Date: Fri, 13 Feb 2026 18:04:27 +0100 Subject: [PATCH] Fix --git-since not detecting first file change in filtered directories The VFS only sets up file watches via read() and read_dir(), not metadata(). When git filtering caused snapshot_from_vfs to return early for $path directories, read_dir was never called, so no file watch was established. This meant file modifications never generated VFS events and were silently ignored until the server was restarted. Co-Authored-By: Claude Opus 4.6 --- src/snapshot_middleware/project.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/snapshot_middleware/project.rs b/src/snapshot_middleware/project.rs index f59a5c90..2147e796 100644 --- a/src/snapshot_middleware/project.rs +++ b/src/snapshot_middleware/project.rs @@ -160,6 +160,16 @@ pub fn snapshot_project_node( .canonicalize(full_path.as_ref()) .unwrap_or_else(|_| full_path.to_path_buf()); metadata.relevant_paths.push(normalized); + + // The VFS only sets up file watches via read() and read_dir(), + // not via metadata(). Since the git filter caused snapshot_from_vfs + // to return early (before read_dir was called), the VFS is not + // watching this path. We must read the directory here to ensure + // the VFS sets up a recursive watch, otherwise file change events + // will never fire and live sync won't detect modifications. + if full_path.is_dir() { + let _ = vfs.read_dir(&full_path); + } } }