-
Notifications
You must be signed in to change notification settings - Fork 48
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
Linux: deleting watched folder does not reestablish watching after re-create #66
Comments
Hmm, I guess we'd have to start watching the parent folder when the root dir is deleted to see if it's re-created? Do other watchers handle this on Linux? |
Actually, seems like this causes a crash on Windows currently. I fixed that in #69. But it does not watch again after creating the deleted directory again, same as Linux. I'm leaning toward making this consistent on macOS as well since it seems that's the only one that handles this. Callers of the watcher can detect this case and subscribe to notifications from the parent directory if they need notifications about the directory being re-created. |
From my testing with Btw macOS also has a On Windows: in my testing I was not really able to delete the root that is watched with And on Linux, from my testing:
Maybe worthwhile checking what If |
Sorry, didn't mean to close this. I think after #69 it is consistent across platforms. Do you think looking for a delete event on the watched root is enough for you to know when to establish a watch on the parent directory to look for it to be recreated if needed? |
@devongovett yeah a delete event on all platforms for the root is perfect 👍 . We already have code to reestablish watching on the root when it goes away, we just need that event from parcel watcher. |
In that case, I really can close this! 😀 |
@devongovett just to clarify, is parcel emitting the delete event when the root path is deleted on all platforms already today or does that require a new release? |
Oh nice, I just verified it works on macOS and Linux and requires the changes in here from your PR to work on Windows. I will prepare my branch to be ready for that 👍 |
I tested on Windows, macOS and Linux how the watcher behaves when the path to be watched is being deleted and found that macOS and Windows can deal with this well: when the folder is being restored, watching continues to work (at least from my basic testing that is what I figured).
But on Linux there is a delete event when the path is being deleted but the watching does not pick up again when restoring the folder.
The text was updated successfully, but these errors were encountered: