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 a8c9923df9
commit 0b9c741dac

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'