Skip to content

PollWatcher: detect subsecond mtime changes - #981

Merged
JohnTitor merged 3 commits into
notify-rs:mainfrom
marcoshernanz:fix-pollwatcher-subsecond-mtime
Aug 17, 2026
Merged

PollWatcher: detect subsecond mtime changes#981
JohnTitor merged 3 commits into
notify-rs:mainfrom
marcoshernanz:fix-pollwatcher-subsecond-mtime

Conversation

@marcoshernanz

@marcoshernanz marcoshernanz commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

PollWatcher stores file modification times at whole-second precision. When content comparison is disabled, multiple writes within the same second compare equal and the later write produces no event.
This keeps nanosecond precision for ordinary files so those writes are detected. Directories and content-hashed watches retain their previous whole-second behavior to avoid redundant directory events and preserve existing event classification.
A regression test advances a file mtime twice within one second and verifies a WriteTime event is emitted without content hashing.

Related Issues

@JohnTitor JohnTitor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

@JohnTitor
JohnTitor merged commit 9be985b into notify-rs:main Aug 17, 2026
21 checks passed
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 this pull request may close these issues.

2 participants