fs.watch
doesn't listen changes of file containing JSON stringified if changes happen too quickly (behavior different with non JSON)
#53100
Labels
fs
Issues and PRs related to the fs subsystem / file system.
Version
v20.11.0
Platform
23.2.0 Darwin
Subsystem
node:fs
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
With the code above it happens all the time. But if you change the content of the file to normal string (not JSON stringified) it seems to happen only few times but I don't know why...
Something to keep in mind is that if we add a delay before updating the file, it will always be detected (JSON stringified or not)
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Nothing
Additional information
I wanted to watch changes on a file storing JSON stringified data but the listener passed in
fs.watch
is not called if the change happen too quickly after the call offs.watch
. The strange thing is that if the content is only a text (without JSON format) the watcher emit the event correctly...I have tested this behavior on different version of node :
Before creating this issue here, I created a help request ( #53111 ) where other members confirmed this strange behavior
The text was updated successfully, but these errors were encountered: