Remove processing of collections of activities (#39932)

This commit is contained in:
Claire authored and GitHub committed 2026-07-28 08:30:21 +00:00
1 parent dfa77897ca
commit 8552bd79b0
4 files changed
+9 -24

No files matched your search

@@ -1,6 +1,6 @@
# frozen_string_literal: true
class ActivityPub::ProcessCollectionService < BaseService
class ActivityPub::ProcessActivityService < BaseService
include JsonLdHelper
include DomainControlHelper
@@ -64,14 +64,8 @@ class ActivityPub::ProcessCollectionService < BaseService
@json.delete('signature') unless safe_for_forwarding?(original_json, @json)
end
case @json['type']
when 'Collection', 'CollectionPage'
process_items @json['items']
when 'OrderedCollection', 'OrderedCollectionPage'
process_items @json['orderedItems']
else
process_items [@json]
end
activity = ActivityPub::Activity.factory(@json, @account, **@options)
activity&.perform
rescue JSON::ParserError
nil
end
@@ -90,15 +84,6 @@ class ActivityPub::ProcessCollectionService < BaseService
%w(Delete Reject Undo Update).include?(@json['type'])
end
def process_items(items)
items.reverse_each.filter_map { |item| process_item(item) }
end
def process_item(item)
activity = ActivityPub::Activity.factory(item, @account, **@options)
activity&.perform
end
def actor_from_verified_ld_signature
return unless @json['signature'].is_a?(Hash)
return if domain_not_allowed?(@json['signature']['creator'])
+1 -1
View File
@@ -13,7 +13,7 @@ class ActivityPub::ProcessingWorker
return if actor.nil?
ActivityPub::ProcessCollectionService.new.call(body, actor, override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true)
ActivityPub::ProcessActivityService.new.call(body, actor, override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true)
rescue ActiveRecord::RecordInvalid => e
Rails.logger.debug { "Error processing incoming ActivityPub object: #{e}" }
end