Closed hansenc closed 4 years ago
Sorry I haven't had a chance to look into this yet. If you have an idea of the cause I'm happy to discuss here or help out with a pull request.
I haven't looked further, but it may be related to file hashing (enabled by default) since the test passes with file hashing disabled (both absolute and relative paths). I needed to turn off file hashing for my use case anyway and I haven't run into this since.
Oh, okay, I think I see what's happening now. The hash takes into account both the path of the file and the content. It's actually the intended behavior for it to not emit an event if the content hasn't changed. The modify time isn't taken into account in the hash (maybe it should be, but that's another question...). The bug here is that we aren't standardizing the path in this case, so we are seeing these as different paths from a hashing perspective.
Using directory-watcher 0.9.9 on macOS Mojave 10.14.6, the following test fails:
.. but if you use
.path(testFile.getParent())
instead, it passes. Then, hardcode an absolute path and it fails again.