Skip to content

Commit 1834dc1

Browse files
authored
fix: handle another fs event to fix change monitoring on Windows 10 (#2575)
1 parent fa44229 commit 1834dc1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fs_utils.rs

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ fn get_relevant_event_kind(event_kind: &EventKind) -> Option<SimpleFileSystemEve
3939
Some(SimpleFileSystemEventKind::Create)
4040
}
4141
EventKind::Modify(ModifyKind::Data(_))
42+
// Windows 10 only reports modify events at the `Any` granularity.
43+
| EventKind::Modify(ModifyKind::Any)
4244
// Intellij modifies file metadata on edit.
4345
// https://github.com/passcod/notify/issues/150#issuecomment-494912080
4446
| EventKind::Modify(ModifyKind::Metadata(MetadataKind::WriteTime))
@@ -178,6 +180,7 @@ mod tests {
178180
let cases = vec![
179181
(EventKind::Create(CreateKind::File), Some(SimpleFileSystemEventKind::Create)),
180182
(EventKind::Create(CreateKind::Folder), Some(SimpleFileSystemEventKind::Create)),
183+
(EventKind::Modify(ModifyKind::Any), Some(SimpleFileSystemEventKind::Modify)),
181184
(
182185
EventKind::Modify(ModifyKind::Data(DataChange::Size)),
183186
Some(SimpleFileSystemEventKind::Modify),

0 commit comments

Comments
 (0)