Skip to content

Creating and Removing a File Results In Duplicate Create Events #715

@kevinchevalier

Description

@kevinchevalier

MacOS Sequoia 15.6.1

When I quickly create, and then delete a file I'm seeing a confusing series of messages from notify-rs.

RUN echo hey > hey.txt

⚡ * RAW EVENT:
  Raw event kind: Create(File)
  Raw paths: ["hey.txt"]
------------------------------

⚡ * RAW EVENT:
  Raw event kind: Modify(Metadata(Extended))
  Raw paths: ["hey.txt"]
------------------------------

⚡ * RAW EVENT:
  Raw event kind: Modify(Data(Content))
  Raw paths: ["hey.txt"]
------------------------------

🎯 * DEBOUNCED EVENTS:
  Debounced event: Create(File)
  Paths: ["hey.txt"]
  Time: Instant { tv_sec: 168101, tv_nsec: 745760791 }
==================================================

RUN rm hey.txt

⚡ * RAW EVENT:
  Raw event kind: Create(File)
  Raw paths: ["hey.txt"]
------------------------------

⚡ * RAW EVENT:
  Raw event kind: Remove(File)
  Raw paths: ["hey.txt"]
------------------------------

⚡ * RAW EVENT:
  Raw event kind: Modify(Metadata(Extended))
  Raw paths: ["hey.txt"]
------------------------------

⚡ * RAW EVENT:
  Raw event kind: Modify(Data(Content))
  Raw paths: ["hey.txt"]
------------------------------

🎯 * DEBOUNCED EVENTS:
  Debounced event: Modify(Metadata(Extended))
  Paths: ["hey.txt"]
  Time: Instant { tv_sec: 168103, tv_nsec: 773937208 }
  Debounced event: Modify(Data(Content))
  Paths: ["hey.txt"]
  Time: Instant { tv_sec: 168103, tv_nsec: 773942916 }

The create event is emitted both after file creation and after the file is deleted. I'm performing these operations quickly, but well over the debounce window. The end result is that the remove event is never emitted by the debouncer.

I've created this small script to try it out. https://github.com/kevinchevalier/fswatcher/tree/master

Is this expected or is something not working correctly?

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