Add support for numeric IDs to local account lookup via URI
Some checks failed
Chromatic / Run Chromatic (push) Has been cancelled

This commit is contained in:
Claire 2025-03-31 15:18:48 +02:00
parent 467d61bce7
commit 2cadc7ab3b
2 changed files with 2 additions and 3 deletions

View File

@ -275,10 +275,9 @@ class ActivityPub::TagManager
path_params = Rails.application.routes.recognize_path(uri)
# TODO: handle numeric IDs
case path_params[:controller]
when 'accounts'
[:username, path_params[:username]]
path_params.key?(:username) ? [:username, path_params[:username]] : [:id, path_params[:id]]
when 'instance_actors'
[:id, -99]
end

View File

@ -6,7 +6,7 @@ RSpec.describe ActivityPub::SynchronizeFollowersService do
subject { described_class.new }
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account', inbox_url: 'http://example.com/inbox') }
let(:alice) { Fabricate(:account, username: 'alice') }
let(:alice) { Fabricate(:account, username: 'alice', id_scheme: :numeric_ap_id) }
let(:bob) { Fabricate(:account, username: 'bob') }
let(:eve) { Fabricate(:account, username: 'eve') }
let(:mallory) { Fabricate(:account, username: 'mallory') }