Skip to content

Commit

Permalink
fix: handle another fs event to fix change monitoring on Windows 10 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
iamorphen authored and Keats committed Aug 15, 2024
1 parent b3fc3f4 commit 64c868c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fs_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 64c868c

Please sign in to comment.