Skip to content

fix: debounce events - #711

Merged
JohnTitor merged 2 commits into
notify-rs:mainfrom
rolldown:fix/debounce-events
Oct 4, 2025
Merged

fix: debounce events#711
JohnTitor merged 2 commits into
notify-rs:mainfrom
rolldown:fix/debounce-events

Conversation

@sapphi-red

Copy link
Copy Markdown
Contributor

When multiple events happened within the timeout, the events were not deduped.

To explain it more precisely, the return value of DebounceDataInner::debounced_events never contained a duplicate event, but event_handler was called multiple times for events within the timeout.

For example, when the timeout is 8 and the tick rate is 2, consider the following events:

  • 0: modify event
  • 3: modify event

event_handler is called with 0: modify event on 2, and 3: modify event on 4. But these two events are within the timeout so the event_handler should be only called with 3: modify event on 12. (It is 12 because that is the first tick after the timeout has passed from the last event)

graphite-app Bot pushed a commit to rolldown/rolldown that referenced this pull request Sep 10, 2025
Temporary switch to my fork with a patch (notify-rs/notify#711) until the PR is merged.

@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.

Yeah, these events should be consolidated, thanks!

@JohnTitor
JohnTitor force-pushed the fix/debounce-events branch from 453ac66 to 7e6bc51 Compare October 4, 2025 21:55
@JohnTitor
JohnTitor merged commit 978fe71 into notify-rs:main Oct 4, 2025
3 checks passed
@sapphi-red
sapphi-red deleted the fix/debounce-events branch January 7, 2026 11:21
JohnTitor pushed a commit that referenced this pull request Jan 16, 2026
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