watcher icon indicating copy to clipboard operation
watcher copied to clipboard

Linux: create/delete coalescing into modification events has broken inotify watching

Open Kynde opened this issue 2 years ago • 10 comments

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:

  1. parcel serve running
  2. make a change to a .jsx file that's easy to detect
  3. change is detected nicely and page reloads
  4. git checkout <aforementioned .jsx file>
  5. 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.

Kynde avatar Nov 09 '22 11:11 Kynde