🟡 [M4] watcher 后端错误被静默丢弃 #14
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:57-60分类: 错误处理
问题: watcher backend 错误(I/O 错误、rescan 错误等)被
Err(_) => return静默忽略,应用不知道监控已失效。建议修复: 添加
FileEvent::WatcherError(String)或暴露错误通道;至少日志记录并触发重新同步。修复提交:
7852e92修复内容:
FileEventenum 新增WatcherError { message: String }变体,用于传递 notify 后端错误Err(_) => return替换为try_send(FileEvent::WatcherError),错误通过现有 bounded channel 转发给消费者poll_file_watcher新增WatcherErrormatch 分支,瞬态错误不中断 UIWatcherErrorequality 测试设计决策:
{ message: String }命名载荷,与其他变体风格一致,便于未来扩展try_send而非send,避免在 notify 后端线程上阻塞