-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watcher does not detect (re)moving a parent directory #77
Comments
That's interesting. It's possible the Java WatchService is not firing any events in that case, because the event occurred on the parent and not on the watched directories. Which operating systems have you tried on? I definitely think we need more clear and consistent behavior when roots and parents of roots get deleted. |
I've tested it on Windows and macos, and there's a bit different behaviour. Delete
Delete
So, looks like macos's native library detects when the path is gone, and win's doesn't. |
How does the watcher behave when the deleted/moved directories are put back in place? |
That likely also depends on the OS implementation |
In our project we subscribe for multiple tracked folders, and when any of them is (re)moved, the watcher closes itself, and that can be tracked in a completable future.
Example watched paths:
/Users/user/parentDir/watchedDir1
/Users/user/parentDir/watchedDir2
However, when we move the
parentDir
out of the scope (or simply delete it), the watcher stays silent and keeps watching the basically invalid paths. When the tree is recreated, the changes are detected automatically.This behaviour looks a bit weird as I'd expect at least some callback from the watcher. Why would it watch the invalid path?
Thank you.
The text was updated successfully, but these errors were encountered: