Skip to content

Inotify backend: missing file events when created inside a new directory #243

@hyrious

Description

@hyrious

Screenshot

Notice the create /app/tasks/test/task.oo.yaml event is missing multiple times.

Image

Reproduction

  1. docker run -it node:24, or maybe you can try other distros

    To be clear: Linux 8eb45a201177 6.17.8-orbstack-00308-g8f9c941121b1 #1 SMP PREEMPT Thu Nov 20 09:34:02 UTC 2025 aarch64 GNU/Linux

  2. mkdir -p /app/tasks && cd /app && npm init -y && npm add -D @parcel/watcher

  3. touch /app/test.js, file content:

    const fs = require('fs')
    const task = `hello`
    if (fs.existsSync('tasks/test')) {
        fs.rmSync('tasks/test', { recursive: true })
    } else {
        fs.mkdirSync('tasks/test')
        fs.writeFileSync('tasks/test/task.oo.yaml', task)
    }
  4. touch /app/watch.js, file content:

    const p = require('@parcel/watcher')
    p.subscribe('/app', (e, events) => {
        if (e) console.error(e);
        for (const ev of events) {
            console.log(ev.type, ev.path)
        }
    }, {
        backend: 'inotify',
        ignore: ['node_modules', '.git']
    })
    console.log('Running')
  5. run node watch.js in one long running session, you may use tmux

  6. run node test.js several times

This is probably because the file creation is too fast to be picked up by the new inotify watcher.

This issue is found in the VS Code remote mode where the UI is not updated correctly beacuse the file change event was missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions