Skip to content

Commit

Permalink
Fix status processing failing halfway when a remote post has a malfor…
Browse files Browse the repository at this point in the history
…med `replies` attribute (mastodon#31246)
  • Loading branch information
ClearlyClaire authored Aug 2, 2024
1 parent 6a27a8c commit 2a704ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/lib/activitypub/activity/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,15 @@ def resolve_thread(status)

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)
Expand Down

0 comments on commit 2a704ad

Please sign in to comment.