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); + } } }