mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-29 01:58:44 +01:00
Fix status processing failing halfway when a remote post has a malformed replies
attribute (#31246)
This commit is contained in:
parent
a5641a9244
commit
fe92b241b2
1 changed files with 3 additions and 1 deletions
|
@ -332,13 +332,15 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
|
||||
def fetch_replies(status)
|
||||
collection = @object['replies']
|
||||
return if collection.nil?
|
||||
return if collection.blank?
|
||||
|
||||
replies = ActivityPub::FetchRepliesService.new.call(status, collection, allow_synchronous_requests: false, request_id: @options[:request_id])
|
||||
return unless replies.nil?
|
||||
|
||||
uri = value_or_id(collection)
|
||||
ActivityPub::FetchRepliesWorker.perform_async(status.id, uri, { 'request_id' => @options[:request_id] }) unless uri.nil?
|
||||
rescue => e
|
||||
Rails.logger.warn "Error fetching replies: #{e}"
|
||||
end
|
||||
|
||||
def conversation_from_uri(uri)
|
||||
|
|
Loading…
Reference in a new issue