-
Notifications
You must be signed in to change notification settings - Fork 66
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
Prevent change on add in node watcher #86
Conversation
This should never happen since we filter change events on dirs here. Any idea how to reproduce this locally? I wasn't able to. |
If you clone the pr branch and
|
@xdissent thanks for the dockerfile. Very convenient. So I misunderstood that the change event is triggered on the directory. In this case can we just ignore the change event. No need to debounce the add event again. I'll leave an inline comment. |
@@ -317,6 +317,11 @@ NodeWatcher.prototype.processChange = function(dir, event, file) { | |||
|
|||
NodeWatcher.prototype.emitEvent = function(type, file, stat) { | |||
var key = type + '-' + file; | |||
var addKey = ADD_EVENT + '-' + file; | |||
if (type === CHANGE_EVENT && this.changeTimers[addKey]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return from here. And add a comment to say something like:
// Ignore the change event that is immediately fired after an add event.
// (This happens on Linux).
should we do a release soon or do you have other things in the works/needs addressing for watchpack? /cc @wtgtybhertgeghgtwtg |
If it's a minor release, I don't have any complaints. I'd like to get #90 in, but it's breaking/not vital. |
published 1.6 |
Turns change events into add events if the add event hasn't yet been emitted. Fixes #75.