-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Follow symlinks outside of watched folder #232
base: main
Are you sure you want to change the base?
Conversation
Looks like tests are failed, can you fix it? |
Solves webpack#231 and updates the README to match.
Still got a lot of remote environments failing the tests, but the machines I've tested on have been passing 100% of the unit tests reliably. I'll see if I can reproduce the failures somehow, unless it's not necessary as the required ones are passing. |
It's always the polling servers failing and I don't know why. |
|
Will it help? |
Well, I've already seen the logs, I'm just wondering if you know whats different about the polling servers vs the normal ones, as only the polling servers are reliably failing these tests. |
I did some changes, please rebase |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #232 +/- ##
==========================================
- Coverage 91.55% 90.15% -1.41%
==========================================
Files 6 6
Lines 1042 1056 +14
Branches 250 256 +6
==========================================
- Hits 954 952 -2
- Misses 88 104 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Weird... Need to to tests... |
Ok so the issue is with the WATCHPACK_POLLING env variable. I guess that's what was different about those "polling" servers. I'm guessing the initial parameter in doScan is probably what's screwing things up, I'll look into fixing it. |
Feel free to feedback |
fb9accd
to
fa835be
Compare
lib/DirectoryWatcher.js
Outdated
@@ -106,13 +106,14 @@ class DirectoryWatcher extends EventEmitter { | |||
} | |||
} | |||
}; | |||
this.watcher.on("change", this.onWatchEvent.bind(this)); |
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.
I am afraid about perf here...
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.
Didn't end up being necessary anyway, the new solution is simpler
Tests are stuck again, should work this time tho |
41032a3
to
8aafd4a
Compare
The only thing now is that Watchpack Errors will print for a moment when a followed symlink is invalid, which is the case for a few of the tests, however this seems like it should be the correct behavior anyway, unless we don't want to warn users at all when an invalid symlink is watched. |
Ok looks like Windows is still failing when polling actually |
lib/DirectoryWatcher.js
Outdated
this.watcherManager.options.followSymlinks | ||
) { | ||
try { | ||
symlinkStats = fs.statSync(itemPath); |
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.
Do we need to do it in the sync way?
It should now be able to watch symlinks that lead to outside of the watched folder when polling
/cc @sokra Can you review it? |
there was a change i had made at one point that had fixed polling on the ubuntu servers, i probably shouldn't have force pushed, i just didn't want to have 1000 commits lol. Let me see if I can figure out what it had been before a code review, the one thing I can't figure out is why it doesnt work on windows. |
Looks like two tests are broken on all OS... |
Solves #231 and updates the README to match. Next.js depends on this package, and this would make development much nicer (vercel/next.js#53175).