watchFile never fires when vfs uses a real dir
Đang mở
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.4k
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 272
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với test.js và các entry point node:vfs cho RealFSProvider và watchFile, sau đó tái hiện vấn đề bằng node --experimental-vfs test.js. Theo dõi lý do listener không được gọi sau khi /tmp/a.txt thay đổi; hoàn tất khi ví dụ báo called? true.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- operating-systems
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100