Bug Report: fs.promises.watch() emits change before file is saved #4559
-
Versionv22.14.0 Platform
SubsystemNo response What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?It happens every time I edit the file quickly. Even a single character change is enough to trigger the issue. There's no special condition — just editing command.txt (for example, in VS Code or nano) will do it. What is the expected behavior? Why is that the expected behavior?
What do you see instead?Instead we see something like this:
Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 1 reply
-
Converted to a discussion because what you're seeing is not a bug, just a quirk or maybe a mismatched expectation. Your editor saves the file in multiple discrete steps and node1 picks up and reports the first one. 1 Not really node either; the event is reported by the operating system - i.e., the canonical source of truth - to node, which then passes it on to you. |
Beta Was this translation helpful? Give feedback.
Converted to a discussion because what you're seeing is not a bug, just a quirk or maybe a mismatched expectation. Your editor saves the file in multiple discrete steps and node1 picks up and reports the first one.
1 Not really node either; the event is reported by the operating system - i.e., the canonical source of truth - to node, which then passes it on to you.