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.
This commit is contained in:
Joe 2026-03-12 19:48:17 -05:00
parent a727881e6f
commit 34375d1339

View file

@ -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) {