In our implementation of watch events, we assume path names are enough to trigger events: a file is changed, we use the path to look at registered watchers (for that path or path prefix), and fire off events. This breaks for hard links created with fs.link().
We probably need to do more work when we register the watch. Maybe we stat the path and get the file node's id (in the case of a file). Or maybe we can borrow something from chokidar. What we do for file paths will also need to be thought through for dirs.
This is a bit of an edge case, and I'm not sure how much work to do to support it. But I'm going to land a test and skip() it, so we can return to this later.
In our implementation of watch events, we assume path names are enough to trigger events: a file is changed, we use the path to look at registered watchers (for that path or path prefix), and fire off events. This breaks for hard links created with
fs.link()
.We probably need to do more work when we register the watch. Maybe we
stat
the path and get the file node'sid
(in the case of a file). Or maybe we can borrow something from chokidar. What we do for file paths will also need to be thought through for dirs.This is a bit of an edge case, and I'm not sure how much work to do to support it. But I'm going to land a test and
skip()
it, so we can return to this later.