Skip to content

Comments

Do not remove a filename twice#683

Merged
dfaust merged 1 commit intonotify-rs:mainfrom
worr:bug/dont-unwatch-twice
May 6, 2025
Merged

Do not remove a filename twice#683
dfaust merged 1 commit intonotify-rs:mainfrom
worr:bug/dont-unwatch-twice

Conversation

@worr
Copy link
Contributor

@worr worr commented May 6, 2025

When unwatching a directory that was watched recursively, notify's kqueue impl would first unwatch the containing directory, then walk it to unwatch all the items inside.

However, walking the directory first processes the containing directory, and unwatching a directory twice can cause an error in the kqueue crate.

Fixes #665 and adds a test to prevent regressions.

@dfaust
Copy link
Member

dfaust commented May 6, 2025

Thanks a bunch. Just one thing. Would you mind adding it to the change log?

When unwatching a directory that was watched recursively, notify's kqueue impl
would first unwatch the containing directory, then walk it to unwatch all
the items inside.

However, walking the directory first processes the containing directory, and
unwatching a directory twice can cause an error in the kqueue crate.

Fixes notify-rs#665 and adds a test to prevent regressions.
@worr worr force-pushed the bug/dont-unwatch-twice branch from 2a97aea to c11e831 Compare May 6, 2025 17:33
@worr
Copy link
Contributor Author

worr commented May 6, 2025

@dfaust Done, let me know if there are issues with the format or anything you want me to change

@dfaust
Copy link
Member

dfaust commented May 6, 2025

Thank you!

@dfaust dfaust merged commit 2c43cc6 into notify-rs:main May 6, 2025
17 checks passed
@worr worr deleted the bug/dont-unwatch-twice branch May 6, 2025 18:26
JohnTitor pushed a commit that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kqueue always returns an "No such file or directory" on Watcher::unwatch

2 participants