fix: handle another fs event to fix change monitoring on Windows 10 (#2575)

This commit is contained in:
orphen 2024-07-29 18:19:46 +09:00 committed by Vincent Prouillet
parent b3fc3f49cf
commit 64c868c3d4

View file

@ -39,6 +39,8 @@ fn get_relevant_event_kind(event_kind: &EventKind) -> Option<SimpleFileSystemEve
Some(SimpleFileSystemEventKind::Create)
}
EventKind::Modify(ModifyKind::Data(_))
// Windows 10 only reports modify events at the `Any` granularity.
| EventKind::Modify(ModifyKind::Any)
// Intellij modifies file metadata on edit.
// https://github.com/passcod/notify/issues/150#issuecomment-494912080
| EventKind::Modify(ModifyKind::Metadata(MetadataKind::WriteTime))
@ -178,6 +180,7 @@ mod tests {
let cases = vec![
(EventKind::Create(CreateKind::File), Some(SimpleFileSystemEventKind::Create)),
(EventKind::Create(CreateKind::Folder), Some(SimpleFileSystemEventKind::Create)),
(EventKind::Modify(ModifyKind::Any), Some(SimpleFileSystemEventKind::Modify)),
(
EventKind::Modify(ModifyKind::Data(DataChange::Size)),
Some(SimpleFileSystemEventKind::Modify),