watcher
watcher copied to clipboard
Linux: create/delete coalescing into modification events has broken inotify watching
I ran into some problems with file watching in parcel on linux (recent Fedora). Parcel 2.8.0 with watcher 2.0.7.
Steps to reproduce the problem:
- parcel serve running
- make a change to a .jsx file that's easy to detect
- change is detected nicely and page reloads
- git checkout <aforementioned .jsx file>
- parcel loses all tracking to that file
If caching is used, the sad state remains. With --no-cache it works again after a restart. Similar problems can be done with git stash and git pop.
git checkout
deletes the dirty file when it's checking it out again. With inotifywait it's easy to see that the file gets deleted and then replaced with a new one.
This likely makes the inotify based system lose track of the file. Either the parent directory changes of a file are not being watched or they are handled incorrectly.
I first ran into this problem with my vim
, but that I could configure so that it doesn't delete the file, but git
is a bit much.
Based on a coworker this is not a problem on a Mac.