Repository navigation
fix: keep notifying remaining listeners when one raises - #410
Open
alexcastgonz (pcbeingused333) wants to merge 1 commit into
Open
alexcastgonz (pcbeingused333) wants to merge 1 commit into
alexcastgonz (pcbeingused333) wants to merge 1 commit into
Conversation
send_notifications returned from the loop after logging a failing callback, so every listener registered after it was skipped. Log the error and continue; the method still returns nil.
This branch has not been deployed
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.
Summary
NotificationCenter#send_notifications: when a listener raises, log the error and keep notifying the remaining listeners instead of returning from the method.The
rescueinside theeachblock didreturn nilafter logging, which exitssend_notificationsentirely. One faulty listener (e.g. an analytics integration hooked toACTIVATE/DECISION) therefore silently prevented every listener registered after it for that notification type from being called. The method still returnsnil, so its contract is unchanged.Test plan
spec/notification_center_spec.rb: two listeners on the same type, the first raises; the second must still be called and the error logged. It fails onmaster(second listener never called) and passes with this change.bundle exec rspec spec/notification_center_spec.rb: 32 examples, 0 failures.Issues
This change was prepared with the assistance of an AI coding assistant (Claude Code).
🤖 Generated with Claude Code