thin-edge.io
thin-edge.io copied to clipboard
fs_notify generates events on wrong directory paths
Describe the bug
When fs_notify adds a watcher on different directories
, and when the file is added/removed
in one directory, the notification will be generated for all the directories.
To Reproduce
Expected behavior
It should generate the notification only for the directory where some change has happened
.
Screenshots
Environment (please complete the following information):
- OS [incl. version]
- Hardware [incl. revision]
- System-Architecture [e.g. result of "uname -a"]
- thin-edge.io version [e.g. 0.1.0]
Additional context
Action points
- @initard Work on https://github.com/hannobraun/inotify-rs/pull/193 further. It will give us the file ID, which will fix our issue.
- @PradeepKiruvale Start using @initard's branch as of now.
If we cannot make it merge whatever reason, we will use @initard's branch (as a workaround).
Submitted the fix, waiting for it to be approved and merged.
@PradeepKiruvale this is the test that checks for two files with the same name: https://github.com/hannobraun/inotify-rs/blob/760a15664fbf6b2bcf770b8cffae3433e1de80ae/tests/main.rs#L347-L403 maybe it helps you with implementing it in our crate.
And here is my fork and branch with the fix: https://github.com/initard/inotify-rs/tree/improvement/inotify-two-files-with-the-same-name
Thanks, @initard I will have a look. I tried using the git
path for fs-notify
as below
inotify = { git = "https://github.com/initard/inotify-rs", branch = "improvement/inotify-two-files-with-the-same-name" } It's not working, @didier-wenzek, any idea what's wrong here?
inotify = { git = "https://github.com/initard/inotify-rs", branch = "improvement/inotify-two-files-with-the-same-name" } It's not working, @didier-wenzek, any idea what's wrong here?
Is there an error?
EDIT:
I tried too and to me it works.
I added this to crates/common/tedge_utils/Cargo.toml
inotify = { git = "https://github.com/initard/inotify-rs", branch = "improvement/inotify-two-files-with-the-same-name", optional = true }
Resolved with #1456
The further refactoring of fs-notify
crate will be done as part of https://github.com/thin-edge/thin-edge.io/issues/1484
QA check passed, therefore close this issue.