Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression in incremental Watchman queries on Windows (#1231)
Summary: Pull Request resolved: #1231 D52513808 / #1210 introduced a startup regression in Watchman crawling on Windows where a clock key was incorrectly calculated due to more strict behaviour around path separators. This meant the clock was not matched with cached state, and the crawler would fall back to a "glob" query, rather than the (typically much cheaper) incremental "since" query. The bug isn't in the new `RootPathUtils` itself, which already states its assumptions (including `"All input path separators must be system-native."`), but rather in the failure to properly normalise a particular response from Watchman (which returns posix separators, even on Windows) to Metro's system-native paths, before using `pathUtils.absoluteToNormal`. Note that we already normalise other responses from Watchman to system separators. Before D52513808 / #1210 we would've deemed the path too complex to handle and fallen back to `path.relative`, which is much slower but more forgiving. Changelog ``` * **[Fix]**: Fix startup time regression when using Watchman on Windows with a warm cache. ``` Reviewed By: motiz88 Differential Revision: D54592646 fbshipit-source-id: de91b1a724fcec470e93650ec9c6adce8c148aac
- Loading branch information