2
0

Add support for numeric-based URIs for local accounts (#32724)

This commit is contained in:
Claire
2025-09-29 14:05:48 +02:00
committed by GitHub
parent 4d7c208da3
commit 150f0fcba5
20 changed files with 324 additions and 52 deletions

View File

@@ -563,6 +563,22 @@ RSpec.describe Account::Interactions do
me.follow!(remote_alice)
expect(remote_alice.local_followers_hash).to eq Digest::SHA256.hexdigest(ActivityPub::TagManager.instance.uri_for(me))
end
context 'when using numeric ID based scheme' do
let(:me) { Fabricate(:account, username: 'Me', id_scheme: :numeric_ap_id) }
it 'returns correct hash for local users' do
expect(remote_alice.local_followers_hash).to eq Digest::SHA256.hexdigest(ActivityPub::TagManager.instance.uri_for(me))
end
it 'invalidates cache as needed when removing or adding followers' do
expect(remote_alice.local_followers_hash).to eq Digest::SHA256.hexdigest(ActivityPub::TagManager.instance.uri_for(me))
me.unfollow!(remote_alice)
expect(remote_alice.local_followers_hash).to eq '0000000000000000000000000000000000000000000000000000000000000000'
me.follow!(remote_alice)
expect(remote_alice.local_followers_hash).to eq Digest::SHA256.hexdigest(ActivityPub::TagManager.instance.uri_for(me))
end
end
end
describe 'muting an account' do