-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consistent reporting of symlink changes across watcher backends
Summary: Currently, symlinks are reported (similarly to regular files) by all watcher backends when added or removed (if not ignored), *except* in some specific cases: - Symlinks discovered when adding a new subtree are not always reported by `NodeWatcher`. - Symlinks deleted are not reported by `FSEventsWatcher` or `NodeWatcher`. That's simply because we use `walker` to scan files, and it distinguishes symlinks from regular files - we were not listening to the `symlink` event. - In the case of symlinks in very new directories, that meant we didn't emit an `add` event unless we already had a watch on the parent - the scan is expected to race against the recursive watch, so this was non-deterministic. - In the case of symlink deletions, these were not reported by `NodeWatcher` or `FSEventsWatcher` because those rely on an internal set of "tracked" files provided by `walker`, and don't emit events for untracked files that no longer exist. This diff adds a listener for discovered symlinks and tests to verify pre-existing symlinks correctly have their deletion reported. Changelog: [Internal] *(symlink changes are not yet propagated out of `metro-file-map`, so this fix isn't technically observable)* Reviewed By: jacdebug Differential Revision: D41774723 fbshipit-source-id: 0e9e7d0ecd0bdfbb316af7657e7f2599b5dfb49d
- Loading branch information
1 parent
33ead26
commit bcb4d5b
Showing
4 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters