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 eff2d57cdb
commit 06bae4a936

View File

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