From 2a4b205c75fa697f436dfbe9f79192fb401485ff Mon Sep 17 00:00:00 2001 From: David Roetzel Date: Wed, 25 Mar 2026 16:28:20 +0100 Subject: [PATCH] Make sure `Delete` reaches collection owner (#38399) --- app/services/revoke_collection_item_service.rb | 4 +++- spec/services/revoke_collection_item_service_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/services/revoke_collection_item_service.rb b/app/services/revoke_collection_item_service.rb index c0dc70e952..9b5c53f70c 100644 --- a/app/services/revoke_collection_item_service.rb +++ b/app/services/revoke_collection_item_service.rb @@ -6,6 +6,7 @@ class RevokeCollectionItemService < BaseService def call(collection_item) @collection_item = collection_item @account = collection_item.account + @collection = @collection_item.collection @collection_item.revoke! @@ -15,7 +16,8 @@ class RevokeCollectionItemService < BaseService private def distribute_stamp_deletion! - ActivityPub::AccountRawDistributionWorker.perform_async(signed_activity_json, @collection_item.collection.account_id) + ActivityPub::DeliveryWorker.perform_async(signed_activity_json, @account.id, @collection.account.inbox_url) + ActivityPub::AccountRawDistributionWorker.perform_async(signed_activity_json, @collection.account_id) end def signed_activity_json diff --git a/spec/services/revoke_collection_item_service_spec.rb b/spec/services/revoke_collection_item_service_spec.rb index 8ea753dcc5..b4cba82056 100644 --- a/spec/services/revoke_collection_item_service_spec.rb +++ b/spec/services/revoke_collection_item_service_spec.rb @@ -13,12 +13,14 @@ RSpec.describe RevokeCollectionItemService do end context 'when the collection is remote', feature: :collections_federation do - let(:collection) { Fabricate(:remote_collection) } + let(:account) { Fabricate(:remote_account, inbox_url: 'https://example.com/actor/1/inbox') } + let(:collection) { Fabricate(:remote_collection, account:) } let(:collection_item) { Fabricate(:collection_item, collection:, uri: 'https://example.com') } it 'federates a `Delete` activity' do subject.call(collection_item) + expect(ActivityPub::DeliveryWorker).to have_enqueued_sidekiq_job.with(instance_of(String), collection_item.account_id, 'https://example.com/actor/1/inbox') expect(ActivityPub::AccountRawDistributionWorker).to have_enqueued_sidekiq_job end end