-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Non recursive watch requests are not refcounted #151916
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.68.0. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
File events are not guaranteed to be single, so it is totally expected that you get 2 or even more events. For example, file writes via node.js are often a How do you change the file? Is this native windows, or WSL? |
How do you change the file? Is this native windows, or WSL? in our project, we use FileSystemWatcher in many case. |
Do you see the same issue when using Windows file system without WSL? |
Hello,
|
when I set But I'm worried that it doesn't exactly match the file name. I think setting |
And the 2 events are reported when you use VSCode to make a change to the file? |
yes, I made a change to the file using VSCode. |
I tested this with bare node.js and get the same result, so this is standard node.js behaviour: const fs = require("fs");
fs.watch("C:\\Users\\bpasero\\Desktop\\empty\\new.js", console.log);
fs.writeFileSync("C:\\Users\\bpasero\\Desktop\\empty\\new.js", 'Hello World'); When installing a recursive file watcher (via complex glob pattern, e.g. including Unfortunately that watcher does not support flat (non-recursive) file watching, otherwise we would never use node.js watcher. I had asked for this in parcel-bundler/watcher#92 Closing as designed / upstream, sorry. |
Nevermind, while it is true that node.js emits 2 events out of the box, we actually have logic to deduplicate events in a time frame of The issue here is different:
Let's move into #153009 as a more general issue. For now there is no good solution other than deduplicating on your end, sorry. |
Does this issue occur when all extensions are disabled?: Yes/No
VS Code Version: Version: 1.68.0 (user setup)
Commit: 4af164e
Date: 2022-06-08T11:44:16.822Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS Version: Windows_NT x64 10.0.17134
Steps to Reproduce:
We have .gbs.conf file and watch this file using FileSystemWatcher.
when I set
.gbs.conf
as pattern parameter, onDidChange event fires twice each time.The text was updated successfully, but these errors were encountered: