watcher icon indicating copy to clipboard operation
watcher copied to clipboard

Rename events are occasionally split into two events on linux

Open DanielCodesphere opened this issue 8 months ago • 1 comments

It seems like this can happen if the same file is renamed twice very quickly. The second rename is fine but the first one can be split into two separate rename events, on for the old path and one for the new path. For both of these split events the associated path is null, with no indication which one was created and which was destroyed.

DanielCodesphere avatar Apr 14 '25 10:04 DanielCodesphere

Finally got around to looking at this.

Seems easily reproducible. Have a little script which does the trick. Can be in tool/test in the future for a regression test.

Affects both inotify and fanotify.

No warnings or errors are reported during the test runs I have going (which is good).

Rolling over in my head how safe it is to just drop "invalid" rename events, since the second time these are reported seems consistently fine.

e-dant avatar Apr 20 '25 15:04 e-dant

Fixed in https://github.com/e-dant/watcher/commit/b8b0d8d9638b740a6546c107fba53fdb2decf9ac, released in 0.13.6

e-dant avatar May 26 '25 15:05 e-dant