Open eighty4 opened 3 months ago
(these following observations and events are with fsevents backend)
I used a recursive directory watch without the debouncer and I got two Modify Name Any events for a mv file on OSX
Modify(Name(Any)) ["/Users/adam/work/eighty4/install.sh/lambdas/routes/foo/lambda.get.env"]
Modify(Name(Any)) ["/Users/adam/work/eighty4/install.sh/lambdas/routes/foo/lambda.post.env"]
It seems like the debouncer squashes those into one event. If the watcher is for a single file and it's moved to a different path and then back to the original path, both Modify Name Anys will have the the watcher is watching with the backend.
If I do multiple mv
during the debounce duration, then the path just gets repeated for the watch path and not the path that it was moved to and back from:
Modify(Name(Both)) ["/Users/adam/work/eighty4/install.sh/lambdas/routes/foo/lambda.js", "/Users/adam/work/eighty4/install.sh/lambdas/routes/foo/lambda.js"]
System details
rustc --version
: 1.80Example usage:
https://github.com/eighty4/l3/blob/dev-mode/src/dev.rs#L107
What you did (as detailed as you can)
After setting up a recursive watch on a directory, doing a move directory dispatches a
Modify(Name(Any))
and does not include a path for the directory's original path.What you expected
I thought there would be enough context to react to the from path and to path for an operation like moving a directory.
What happened
Using this watch, I would never know that
anotherdir
was originallysubdir
, and the app would have to stat every previously tracked file to determine whether they were moved.