Skip to content

vfs: pass listener to fs.watchFile in RealFSProvider - #64542

Open
heyparth1 wants to merge 1 commit into
nodejs:mainfrom
heyparth1:brutus/issue-64536
Open

vfs: pass listener to fs.watchFile in RealFSProvider#64542
heyparth1 wants to merge 1 commit into
nodejs:mainfrom
heyparth1:brutus/issue-64536

Conversation

@heyparth1

Copy link
Copy Markdown

Fixes a bug where watchFile in RealFSProvider ignored the provided listener, causing the callback to never fire when the underlying file changed. The listener is now correctly forwarded to fs.watchFile. Adds a test to verify the listener fires on file changes.

Closes#64536

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem. labels Jul 16, 2026
watchFile(vfsPath, options, listener) {
const realPath = this.#resolvePath(vfsPath);
return fs.watchFile(realPath, options, () => {});
return fs.watchFile(realPath, options, listener);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change maybe duplicated to #64537 ?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ciPRs that need a full CI run.vfsIssues and PRs related to the virtual filesystem subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

watchFile never fires when vfs uses a real dir

3 participants

@heyparth1@Archkon@nodejs-github-bot