fix: compare full event paths when skipping duplicate notices - #2684
Open
Ali-932 wants to merge 2 commits into
Open
fix: compare full event paths when skipping duplicate notices#2684Ali-932 wants to merge 2 commits into
Ali-932 wants to merge 2 commits into
Conversation
benhoyt
approved these changes
Aug 10, 2026
benhoyt
left a comment
Collaborator
There was a problem hiding this comment.
Rationale and logic makes sense to me, thanks for this.
tromai
approved these changes
Aug 11, 2026
tromai
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the fix.
I really appreciate the detailed issue write up.
Comment on lines
+580
to
+583
| self.seen.append(event.handle.path) | ||
| if self.defer_next: | ||
| self.defer_next -= 1 | ||
| event.defer() |
Contributor
There was a problem hiding this comment.
It looks like the intention of this logic is to defer only the first event, since we set obs.defer_next = 1 before the first emit and never touch it again. If that's correct, maybe something like this would be easier to follow:
first = len(self.seen) == 0
self.seen.append(event.handle.path)
if first:
self.defer()
Author
There was a problem hiding this comment.
Good point, i have updated the tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dedup check in
Framework._event_is_in_storage()compared notice pathstruncated at the first
[, which erases the emitter's key and the event kindfor events emitted by keyed objects. While one such event sat deferred,
distinct events (a different instance, or a different event kind) with equal
snapshots and the same observer method were skipped as duplicates and lost.
This changes the comparison to strip only the trailing
[id], matching theintent described in the comment above it.
Added a regression test with two keyed emitters and two event kinds sharing
one observer: it fails before the change (only 1 of 3 events delivered,
assert 1 == 3) and passes after. The fulltest/test_framework.pysuitepasses (100/100).
Fixes #2683