-
Notifications
You must be signed in to change notification settings - Fork 289
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
FileWatch triggers file changed even if only file attributes changed #4706
Comments
Thanks for the report - that definitely looks like an issue. We use (a fork of) a library, and I do see a similar upstream issue: fsnotify/fsnotify#323. I'll see if I can repro on a Windows box and potentially get a fix into our fork. |
Can you reproduce this reliably? I am not seeing it on my Windows 10 machine. If I open files in Notepad, for example, I can see the In your case, is For more context, Tilt watches for actual file system events (create/modify/delete) and does not actually rely on file modification times, as they can be unreliable and have a host of quirks. That said, Tilt trusts the fs events implicitly to mean something did change, see #3690 for discussion over potential improvements to this to consider e.g. file hash to help avoid spurious rebuilds. |
You are right, I have the same behavior as you. But I noticed that when I change an attribute of the file (for exemple: Read Only) the We have security tools which maybe change files attributes in background. |
Ahhh thanks! That makes sense, and is because the file watching code includes attribute changes in its filter but Windows doesn't distinguish between attribute changes and file content changes when it reports the event, so they get lumped in as file writes. See tilt-dev/fsnotify#8. |
This should be fixed in v0.21.1+ - let me know if you still see strange behavior after upgrading |
Thanks a lot for fixing it quickly, I confirm it works ! |
Hello,
I noticed FileWatch detects file change even if the file is accessed but untouched.
Thank you !
Expected Behavior
FileWatch should not detect a change if the file is unchanged.
According to the doc FileWatch should trigger only on create, modify, or delete : "SeenFiles is a list of paths which changed (create, modify, or delete)."
Current Behavior
FileWatch detects a change if the file is accessed.
(you can see that LastWriteTimeUtc does not match with the FileWatch lastEventTime, but LastAccessTimeUtc match)
Context
tilt doctor
OutputThe text was updated successfully, but these errors were encountered: