]> cat aescling's git repositories - mastodon.git/commitdiff
Fix duplicate notification and delivery of mentions (#14378)
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Thu, 23 Jul 2020 13:41:49 +0000 (22:41 +0900)
committerGitHub <noreply@github.com>
Thu, 23 Jul 2020 13:41:49 +0000 (15:41 +0200)
app/services/process_mentions_service.rb

index 3822b7dc5c1a988bb8eebfa9ca37da204e9e32ea..79af3fc546b898afea4184a7dde7f377ade32384 100644 (file)
@@ -36,7 +36,8 @@ class ProcessMentionsService < BaseService
 
       next match if mention_undeliverable?(mentioned_account) || mentioned_account&.suspended?
 
-      mentions << mentioned_account.mentions.where(status: status).first_or_create(status: status)
+      mention = mentioned_account.mentions.new(status: status)
+      mentions << mention if mention.save
 
       "@#{mentioned_account.acct}"
     end