fix(windows): return WatchNotFound when unwatching an unwatched path - #1014
Merged
Merged
Conversation
`ReadDirectoryChangesWatcher::unwatch` always acked with `Ok` because `remove_watch` silently ignored paths that were not being watched. All other backends (inotify, FSEvents, kqueue, poll) return `Error::watch_not_found()` in that case. Make `remove_watch` report whether a watch was removed, and ack `Action::UnwatchAck` with `WatchNotFound` (with the path attached, as inotify does) when nothing was removed. The internal `Action::Unwatch` used by the completion callback stays silent.
y-yagi
force-pushed
the
windows-unwatch-watch-not-found
branch
from
September 30, 2026 08:46
789408b to
853364e
Compare
y-yagi
marked this pull request as ready for review
September 30, 2026 08:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ReadDirectoryChangesWatcher::unwatchalways acked withOkbecauseremove_watchsilently ignored paths that were not being watched. All other backends (inotify, FSEvents, kqueue, poll) returnError::watch_not_found()in that case.Make
remove_watchreport whether a watch was removed, and ackAction::UnwatchAckwithWatchNotFound(with the path attached, as inotify does) when nothing was removed. The internalAction::Unwatchused by the completion callback stays silent.Related Issues
None