Files
fizzy/app/models/notifier/comment_event_notifier.rb
Rosa Gutierrez 60b3c9c772 Fix duplicate push notification for mention and comment event
Event notifiers used the `mentionees` DB association to exclude mentioned
users from comment/card notifications. Since mentions are created async
via Mention::CreateJob, a race condition meant the mentionee list could
be empty when the event notification job ran first, causing the user to
receive both a comment and a mention push notification.

Use `scan_mentionees` instead, which scans the rich text body directly
for mentioned users without depending on Mention records existing yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:56:27 +01:00

13 lines
245 B
Ruby

class Notifier::CommentEventNotifier < Notifier
delegate :creator, to: :source
private
def recipients
card.watchers.without(creator, *source.eventable.scan_mentionees)
end
def card
source.eventable.card
end
end