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

.rename/.renameSync could not trigger FSWatcher when changes are recursive #883

Closed
alienzhou opened this issue Nov 18, 2022 · 1 comment · Fixed by #902
Closed

.rename/.renameSync could not trigger FSWatcher when changes are recursive #883

alienzhou opened this issue Nov 18, 2022 · 1 comment · Fixed by #902
Labels

Comments

@alienzhou
Copy link
Contributor

Renaming the direct child in the folder works as expect.

When I watch / (with recursive: true) and rename the /test/hello.txt file, the watcher is not triggered.

Here is the online demo: https://codesandbox.io/s/stoic-jerry-juxpw4?file=/src/index.js:0-264

// demo code
import { fs } from "memfs";

fs.mkdirSync("/test");
fs.writeFileSync("/test/hello.txt", "World!");

fs.watch("/", { recursive: true }, (eventType, filename) => {
  console.log("watch:", eventType, filename);
});

fs.renameSync("/test/hello.txt", "/test/hello1.txt");
// expect print: watch: change /

Such code works in Node.js (v14.19.3).

@streamich
Copy link
Owner

🎉 This issue has been resolved in version 3.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants