Skip to content
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

fs: add recursive watch for linux #45098

Merged
merged 38 commits into from
Oct 31, 2022
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cdc9349
fs: add recursive watch to linux
anonrig Oct 19, 2022
296646b
fs: replace traverse with readdir for performance
anonrig Oct 21, 2022
77cb9a0
fs: fix linter issues
anonrig Oct 22, 2022
5b72449
fs: move linux watcher to internal/fs/watch
anonrig Oct 22, 2022
87866c3
test: add missing clear interval for linux
anonrig Oct 22, 2022
00ab12d
fs: add promise support to linux watcher
anonrig Oct 22, 2022
cb4b455
test: simplify start and update tests
anonrig Oct 22, 2022
4144949
fs: avoid prototype pollution
anonrig Oct 22, 2022
9a86410
test: improve fs.watch tests
anonrig Oct 23, 2022
8b36541
test: handle edge cases
anonrig Oct 23, 2022
89abb18
fs: handle more linux edge cases
anonrig Oct 23, 2022
f15251f
fs: update requested changes
anonrig Oct 23, 2022
cd240a6
fs: fix circular dependency
anonrig Oct 24, 2022
6311cf5
fs: improve tests
anonrig Oct 24, 2022
d8d2a0c
test: add url as parameter for fs.watch
anonrig Oct 24, 2022
632a4bc
test: update lint errors
anonrig Oct 25, 2022
df610ef
test: fix url error
anonrig Oct 25, 2022
8243dde
test: improve test-fs-watch-recursive.js
anonrig Oct 25, 2022
37a0839
fs: use arrays instead of sets
anonrig Oct 25, 2022
c7512ef
fs: remove lazy loading assert
anonrig Oct 25, 2022
6eee878
fs: revert certain changes
anonrig Oct 26, 2022
a6906f2
fs: add recursive validation to linux watcher
anonrig Oct 26, 2022
6061330
test: improve tests
anonrig Oct 26, 2022
9d596e8
fs: do not throw abort errors
anonrig Oct 26, 2022
d94f365
fs: rename recursive watch
anonrig Oct 26, 2022
b5161e5
fs: adjust implementation
anonrig Oct 26, 2022
6e4299d
fs: add ref and unref to fs.watch
anonrig Oct 26, 2022
2e5d4b3
fs: update async iterator implementation
anonrig Oct 27, 2022
cd3199b
fs: improve watcher
anonrig Oct 28, 2022
d69a565
fs: rename linux watcher
anonrig Oct 29, 2022
28ee387
fs: add support for symlinks
anonrig Oct 29, 2022
8e4e3dd
test: remove redundant test
anonrig Oct 29, 2022
e6019be
fs: rename to nonNativeWatcher
anonrig Oct 29, 2022
1e903a2
fs: update comments
anonrig Oct 30, 2022
b8b87f6
test: update symlink error message
anonrig Oct 30, 2022
ab4f1d2
fs: update implementation
anonrig Oct 30, 2022
c11bb62
test: make fs.watch errors more strict
anonrig Oct 31, 2022
bddb83f
fs: add documentation
anonrig Oct 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: remove redundant test
  • Loading branch information
anonrig committed Oct 29, 2022
commit 8e4e3ddf8955b45806fa39c9fd9dcd873aafc943
25 changes: 0 additions & 25 deletions test/parallel/test-fs-watch-recursive.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,6 @@ const tmpdir = require('../common/tmpdir');
const testDir = tmpdir.path;
tmpdir.refresh();

(async () => {
const filenameOne = 'watch.txt';
const testsubdir = fs.mkdtempSync(testDir + path.sep);
const relativePathOne = path.join(path.basename(testsubdir), filenameOne);
const filepathOne = path.join(testsubdir, filenameOne);
const watcher = fs.watch(testDir, { recursive: true });

let watcherClosed = false;
watcher.on('change', function(event, filename) {
assert.ok(event === 'change' || event === 'rename');

if (filename === relativePathOne) {
watcher.close();
watcherClosed = true;
}
});

await setTimeout(common.platformTimeout(100));
fs.writeFileSync(filepathOne, 'world');

process.once('exit', function() {
assert(watcherClosed, 'watcher Object was not closed');
});
})().then(common.mustCall());

(async () => {
// Add a file to already watching folder

Expand Down