-
Notifications
You must be signed in to change notification settings - Fork 301
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
Add track file ids option to fs watcher #912
Conversation
Thanks for the follow-up pr!
Just to double check. macos and windows with the feature enabled would behave the same as linux without it? |
Correct!
It will scan the file ids and keep them in memory, but won't actually change the emitted events. |
Cool, thanks! Does it even makes sense to have it optional in the first place then? |
Good question. I guess 99% of users would want this feature enabled, because it makes things easier. I wouldn't mind removing the option for now. We can add it back if needed. Btw. I was thinking about the track-file-ids feature not being needed on Linux, and I think will disable it on Linux by default directly in the |
Yeah, imo removing the option is fine. The IPC's performance hit probably makes the cost unnoticable anyway 😅 |
I'd go with consistency on all platforms first and provide the option to disable this, i.e add a feature flag and enable it by default. |
This PR has been made obsolete by a change in the @amrbashir: To be clear, the file id tracking fixes an inconsistency between Windows and MacOS on the one side and Linux on the other. |
Add
trackFileIds
to theDebouncedWatchOptions
.When enabled, the fs watcher gets the filesystem ids of all watched files and keeps them in memory in order to be able to stitch together rename events on Windows and MacOS.
When disabled, users may receive events like:
When enabled, the events would be merged into:
The feature is disabled by default. But we might want to enable it by default, as it is pretty useful.
Also, we may want to automatically disable it on Linux, since inotify emits a cookie for rename events, so
notify-debouncer-full
handles them correctly already.I didn't add a .changes file because
notify-debouncer-full
is new for the v2 release.