Fix thread-unsafe ActivityPub activity dispatch (#37423)

This commit is contained in:
Joshua Rogers 2026-01-10 03:20:59 +11:00 committed by Claire
parent deeaf50472
commit 0cda068918

View file

@ -21,14 +21,13 @@ class ActivityPub::Activity
class << self
def factory(json, account, **)
@json = json
klass&.new(json, account, **)
klass_for(json)&.new(json, account, **)
end
private
def klass
case @json['type']
def klass_for(json)
case json['type']
when 'Create'
ActivityPub::Activity::Create
when 'Announce'