-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Re-watching a path does not honour ignoreInitial
#1386
Comments
Seems to make sense, assuming that is the intended use of "initial files". If we define "initial" as any time you start watching a directory, we should fix this Good to get the opinion of @paulmillr here since it's from before me |
Idk how would we track these files |
Presumably we currently read the directory and emit all the children. Then when we unwatch and watch it, we won't read through it a second time Maybe it's as simple as always reading the directory when you watch one? So we don't need to track anything extra for it. I might be missing something though in my understanding |
It looks like The pull request #1388 handles this by closing the descendants as well as the unwatched path in closePath, but I'm not sure of the function of (or interaction with) |
feels like it makes sense to me. when you remove a watched path, clearing all of its children we just need to decide if this is a breaking change or not and if its the behaviour we're all agreed on as it means we will start emitting events which we didn't used to emit |
Describe the bug
This is a duplicate of #1185, which has been closed, however the test case still fails.
With
ignoreInitial
set to false, when first adding a directory all the initial files are emitted. If the directory is un-watched and then watched again at some point in the future, the initial files are not emitted.Versions (please complete the following information):
To Reproduce:
Expected behavior
Un-watching and then re-watching a directory should cause the initial files to be emitted if
ignoreInitial
is false.The text was updated successfully, but these errors were encountered: