From 34375d13392df3c1a34244455613e844dba662cd Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 12 Mar 2026 19:48:17 -0500 Subject: [PATCH] fix: restore RescanRequired classification in debouncer-full error handler The non-macOS debouncer-full error callback was classifying all errors as WatcherError, missing the empty-paths check that identifies rescan requests. The default error handler treats RescanRequired as recoverable (log + continue) but WatcherError as fatal (process::exit). This meant inotify queue overflows would kill the process instead of triggering a recoverable rescan. --- crates/memofs/src/std_backend.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/memofs/src/std_backend.rs b/crates/memofs/src/std_backend.rs index 071cffcc..0290f0ce 100644 --- a/crates/memofs/src/std_backend.rs +++ b/crates/memofs/src/std_backend.rs @@ -198,9 +198,13 @@ impl StdBackend { } Err(errors) => { for error in errors { - let critical_err = WatcherCriticalError::WatcherError { - error: format!("{:?}", error.kind), - path: error.paths.first().cloned(), + let critical_err = if error.paths.is_empty() { + WatcherCriticalError::RescanRequired + } else { + WatcherCriticalError::WatcherError { + error: format!("{:?}", error.kind), + path: error.paths.first().cloned(), + } }; let _ = error_tx.send(critical_err.clone()); if error_handler(critical_err) {