🟡 [M5] Remove 事件不经过路径过滤,可能误报 #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
文件:
core/watcher/file_watcher.rs:64-73分类: 文件监控
问题:
Remove事件在路径过滤之前就发送FileEvent::Removed,其他事件都经过event.paths过滤。如果 notify 传递了非监控文件的事件,会误报文件删除。建议修复: 将路径过滤移到 match 之前,或对 Remove 事件也做路径检查。
已修复,commit 420b853。
修复方案:将路径过滤移至 event.kind 匹配之前,所有事件类型(包括 Remove)统一经过路径检查。
变更内容:
测试:7 个 watcher 测试全部通过,217 个项目测试全部通过。