Fix remote users not being re-followed after URI change (#39861)

This commit is contained in:
Claire
2026-07-28 11:53:05 +02:00
committed by GitHub
parent 6e368f649a
commit 9748bcfe23

View File

@@ -57,6 +57,7 @@ class ActivityPub::ProcessAccountService < BaseService
@old_public_keys = @account.present? ? (@account.keypairs.pluck(:public_key) + [@account.public_key.presence].compact) : []
@old_protocol = @account&.protocol
@suspension_changed = false
@uri_changed = @account.present? && @account.uri != @uri
if @account.nil?
with_redis do |redis|
@@ -82,9 +83,7 @@ class ActivityPub::ProcessAccountService < BaseService
end
after_protocol_change! if protocol_changed?
# TODO: extend this to an identity change, and do this on `uri` change as well
after_key_change! if all_public_keys_changed? && !signed_with_known_key
after_identity_change! if @uri_changed || (!signed_with_known_key && all_public_keys_changed?)
# TODO: maybe tie tombstones to specific keys? i.e. we don't need to keep tombstones if all keys changed
clear_tombstones! if all_public_keys_changed?
@@ -300,7 +299,7 @@ class ActivityPub::ProcessAccountService < BaseService
ActivityPub::PostUpgradeWorker.perform_async(@account.domain)
end
def after_key_change!
def after_identity_change!
RefollowWorker.perform_async(@account.id)
end