60b3c9c772
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>
13 lines
245 B
Ruby
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
|