Skip to content
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

Changes stopped being reported after the first change event #742

Closed
ghost opened this issue Jul 12, 2018 · 6 comments · Fixed by #791
Closed

Changes stopped being reported after the first change event #742

ghost opened this issue Jul 12, 2018 · 6 comments · Fixed by #791

Comments

@ghost
Copy link

ghost commented Jul 12, 2018

Describe the bug
Chokidar stops reporting a file's changes after the reporting first change event.

Versions (please complete the following information):

  • Chokidar version 2.0.4
  • Node version 10.6.0
  • OS: Arch Linux

To Reproduce
Steps to reproduce the behavior.

  1. Watch a single file
  2. Modify it (the change would be reported)
  3. Modify it again

From here no changes will be reported when the target is updated.

Example:

const chokidar = require("chokidar");
const watcher = chokidar.watch("test.txt");

watcher.on("change", filepath => {
    console.log("Update:", filepath);
});

Expected behavior
The watcher should report changes.

Additional context

  • Renaming the file, then renaming it back avoids this.
  • I would be very surprised if this is the expected behavior.
@jsantell
Copy link

Seeing this on Debian, probably the same as #237

@strets123
Copy link

{ useFsEvents: false, atomic: true }

in the options appears to be a workaround.

@jsantell
Copy link

I'm using chokidar-cli and confirmed the options getting to chokidar are:

{ followSymlinks: false,
  usePolling: false,
  interval: 100,
  binaryInterval: 300,
  ignoreInitial: false,
  persistent: true,
  ignorePermissionErrors: false,
  disableGlobbing: false,
  useFsEvents: false,
  atomic: true,
  awaitWriteFinish: false }

While chokidar-cli doesn't have an interface for atomic or useFsEvents, by default on linux, useFsEvents and usePolling are false by default, forcing atomic to be true -- resulting in this issue still occuring unfortunately

@mitar
Copy link
Contributor

mitar commented Feb 8, 2019

@jsantell It seems this issue happens no matter if atomic is set to true or false? On Linux, I just tried with chokidar-cli and I modified it so that it had atomic explicitly set to true and another time to false and in both cases change was detected only the first time.

@mitar
Copy link
Contributor

mitar commented Feb 8, 2019

I think I fixed this in #791.

@thor
Copy link

thor commented Sep 30, 2020

Per #791 (comment) this should be re-opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants