Fix status edits not always being streamed to mentioned users (#28324)
This commit is contained in:
parent
a8a5c6514f
commit
89a496b42f
2 changed files with 34 additions and 1 deletions
|
@ -74,6 +74,15 @@ class FanOutOnWriteService < BaseService
|
|||
LocalNotificationWorker.push_bulk(mentions) do |mention|
|
||||
[mention.account_id, mention.id, 'Mention', 'mention']
|
||||
end
|
||||
|
||||
next unless update?
|
||||
|
||||
# This may result in duplicate update payloads, but this ensures clients
|
||||
# are aware of edits to posts only appearing in mention notifications
|
||||
# (e.g. private mentions or mentions by people they do not follow)
|
||||
PushUpdateWorker.push_bulk(mentions.filter { |mention| subscribed_to_streaming_api?(mention.account_id) }) do |mention|
|
||||
[mention.account_id, @status.id, "timeline:#{mention.account_id}:notifications", { 'update' => true }]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -162,4 +171,8 @@ class FanOutOnWriteService < BaseService
|
|||
def broadcastable?
|
||||
@status.public_visibility? && !@status.reblog? && !@account.silenced?
|
||||
end
|
||||
|
||||
def subscribed_to_streaming_api?(account_id)
|
||||
redis.exists?("subscribed:timeline:#{account_id}") || redis.exists?("subscribed:timeline:#{account_id}:notifications")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue