Bug Report: fs.promises.watch() emits change before file is saved #4559
Versionv22.14.0 PlatformSubsystemNo 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 |
Answered by
bnoordhuis
Apr 16, 2025
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. |
0 replies
Answer selected by
avivkeller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.