Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSEvents are sometimes not notified due to strip() logic following rename #219

Open
ReallyLiri opened this issue Mar 16, 2023 · 0 comments

Comments

@ReallyLiri
Copy link

ReallyLiri commented Mar 16, 2023

For example in the following action flow on Mac OSX 12.0.1

touch test.txt
mv test.txt renamed.txt
touch test.txt

We do not get notified of the second create of the file.
Logs:

# touch test.txt
2023/03/16 10:50:40.590694 [D] notify.Create|notify.FSEventsIsFile (0x10100) (/Users/liri/tmp/dv_tests/liri-2/test.txt, i=0, ID=91389624, len=1)
2023/03/16 10:50:40.590739 [D] split()=notify.Create|notify.FSEventsIsFile
2023/03/16 10:50:40.590747 [D] 91389624: single event: notify.Create
2023/03/16 10:50:40.591065 [D] dispatching notify.Create on "/Users/liri/tmp/dv_tests/liri-2/test.txt"

# mv test.txt renamed.txt
2023/03/16 10:52:05.820897 [D] notify.Rename|notify.FSEventsIsFile (0x10800) (/Users/liri/tmp/dv_tests/liri-2/test.txt, i=0, ID=91390335, len=2)
2023/03/16 10:52:05.820985 [D] split()=notify.Rename|notify.FSEventsIsFile
2023/03/16 10:52:05.820997 [D] 91390335: single event: notify.Rename
2023/03/16 10:52:05.821023 [D] notify.Rename|notify.FSEventsIsFile (0x10800) (/Users/liri/tmp/dv_tests/liri-2/renamed.txt, i=1, ID=91390336, len=2)
2023/03/16 10:52:05.821032 [D] split()=notify.Rename|notify.FSEventsIsFile
2023/03/16 10:52:05.821039 [D] 91390336: single event: notify.Rename
2023/03/16 10:52:05.821609 [D] dispatching notify.Rename on "/Users/liri/tmp/dv_tests/liri-2/test.txt"
2023/03/16 10:52:05.821634 [D] dispatching notify.Rename on "/Users/liri/tmp/dv_tests/liri-2/renamed.txt"

# touch test.txt
2023/03/16 10:52:24.918202 [D] notify.Create|notify.FSEventsIsFile (0x10100) (/Users/liri/tmp/dv_tests/liri-2/test.txt, i=0, ID=91390549, len=1)
2023/03/16 10:52:24.918230 [D] split()=notify.FSEventsIsFile

You can see its due to the Create flag being stripped from the event.

I suspect the logic of strip() (watcher_fsevents.go) should handle rename events (as create/delete), however since in rename we don't easily know which "side" of the event we handle, I don't see an immediate fix.

@ReallyLiri ReallyLiri changed the title FSEvents are sometimes not notified due to split() logic following rename FSEvents are sometimes not notified due to strip() logic following rename Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant