Open lsegal opened 6 years ago
Any updates on this? The test failure looks like a temporal issue.
Hey @lsegal! Sorry for letting this hang so long, but I'm not sure it's a proper fix - the tree implementation should not try to unwatch something that was already unwatched, thus patching fsevents only would workaround this problem for macOS. If there's a bug, it should be fixed one layer above, but I did not look into this so I can't tell for sure.
The following code reproduces a bug where if you watch a parent and child directory across multiple channels and then call
notify.Stop()
on the either channel, any subsequent calls tonotify.Watch()
on a grandparent directory will fail:Fortunately we can fix this failure by simply not returning
errNotWatched
fromunwatch()
, which simply performs a no-op if there is no active stream for the path whenUnwatch()
is called.