paulmillr / chokidar

Minimal and efficient cross-platform file watching library
https://paulmillr.com
MIT License
10.99k stars 582 forks source link

Fix no events for symlinks with invalid targets #1253

Closed nathanael-ruf closed 1 month ago

nathanael-ruf commented 1 year ago

Even with followSymlinks: false no events (e.g. 'add') were emitted for links with a target that doesn't exist. Not sure about the changes / why we even need the realpath if followSymlinks: false. Also tests seem to fail (at least locally). This is more like a draft PR so far (maybe someone can take over or suggest changes).

Steps to repro:

const chokidar = require('.');
chokidar.watch('tmp', {
    usePolling: true,
    followSymlinks: false
}).on('all', (e, p) => console.log(e, p));
ln -s does-not-exist link