watchFile never fires when vfs uses a real dir
未关闭
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
Version
main
Platform
macOS 26.2
Subsystem
vfs
What steps will reproduce the bug?
test.js:
const vfs = require('node:vfs');
const fs = require('fs');
const v = vfs.create(new vfs.RealFSProvider('/tmp'));
let called = false;
v.watchFile('/a.txt', { interval: 50 }, () => {
called = true;
});
fs.writeFileSync('/tmp/a.txt', 'x');
setTimeout(() => {
console.log('called?', called);
}, 300);
$ node --experimental-vfs test.js
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
called? true
file changed, the listener should run
What do you see instead?
called? false
Additional information
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 test.js 以及 RealFSProvider 和 watchFile 的 node:vfs 入口开始,然后使用 node --experimental-vfs test.js 重现该问题。追踪 /tmp/a.txt 发生变化后 listener 未被调用的原因;完成标准是示例报告 called? true。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nodejs
- 领域
- operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100