From 2f9f21bce017fcc4558713d128558c57b6065bc0 Mon Sep 17 00:00:00 2001 From: David Roetzel Date: Wed, 15 Jul 2026 13:04:10 +0200 Subject: [PATCH] Remove collections when user is suspended (#39809) --- app/services/delete_account_service.rb | 1 + spec/services/delete_account_service_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb index fa19d6ee50..b96e816b34 100644 --- a/app/services/delete_account_service.rb +++ b/app/services/delete_account_service.rb @@ -10,6 +10,7 @@ class DeleteAccountService < BaseService aliases block_relationships blocked_by_relationships + collections conversation_mutes conversations custom_filters diff --git a/spec/services/delete_account_service_spec.rb b/spec/services/delete_account_service_spec.rb index da02d2bd59..60bcf48df3 100644 --- a/spec/services/delete_account_service_spec.rb +++ b/spec/services/delete_account_service_spec.rb @@ -47,6 +47,7 @@ RSpec.describe DeleteAccountService do expect { poll.reload }.to raise_error(ActiveRecord::RecordNotFound) expect { poll_vote.reload }.to raise_error(ActiveRecord::RecordNotFound) expect { account_note.reload }.to raise_error(ActiveRecord::RecordNotFound) + expect { collection.reload }.to raise_error(ActiveRecord::RecordNotFound) end def expect_deletion_of_associated_target_records @@ -74,6 +75,7 @@ RSpec.describe DeleteAccountService do it_behaves_like 'common behavior' do let(:account) { Fabricate(:account) } let(:local_follower) { Fabricate(:account) } + let!(:collection) { Fabricate(:collection, account:) } # rubocop:disable RSpec/LetSetup it 'sends a delete actor activity to all known inboxes' do subject @@ -92,6 +94,8 @@ RSpec.describe DeleteAccountService do let(:account) { Fabricate(:account, inbox_url: 'https://bob.com/inbox', protocol: :activitypub, domain: 'bob.com') } let(:local_follower) { Fabricate(:account) } + let!(:collection) { Fabricate(:remote_collection, account:) } # rubocop:disable RSpec/LetSetup + it 'sends expected activities to followed and follower inboxes' do subject