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

Emit change events for nested directory watchers #35

Closed
wants to merge 2 commits into from

Conversation

mzgoddard
Copy link

Fix #28

Change events are emitted on directory watchers for the immediate
directory being watched after the initial scan. Emit events from nested
watchers after their parents initial scan (they're a new directory) or
after their own scan (the directory existed during their parents
initial scan).

Removed files don't have an mtime. Adding FS_ACCURACY to a 0 or null
mtime results in a non-zero mtime for any FS_ACCURACY that is non-zero.
Other parts of the source rely on mtime being falsy when items are
removed.
For nested watchers, if the parent watcher or nested watcher has
finished its initial scan emit any new changes on the directory's
watcher. This is similar to each shallow directory watcher which emits
a change event for every file change after the initial scan of that
directory. The nested watchers though need to consider if the parent
finished its initial scan if so, any files found during the initial
scan for the nested directory should also be emitted as this is a new
directory created after the parent's initial scan.
@jsf-clabot
Copy link

jsf-clabot commented Dec 2, 2016

CLA assistant check
All committers have signed the CLA.

@mzgoddard
Copy link
Author

I included a change like #33. Happy to drop that commit or make any desired changes.

@SpaceK33z
Copy link
Member

I haven't really looked into this, but would it be possible to add a test for this? That would ensure it will not be removed accidentally in the future...

@sokra
Copy link
Member

sokra commented Jul 10, 2019

fixed

@sokra sokra closed this Jul 10, 2019
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

Successfully merging this pull request may close these issues.

watchpack doesn't emit events on nested directories remove
4 participants