Fix thread-unsafe ActivityPub activity dispatch (#37423)

This commit is contained in:
Joshua Rogers 2026-01-10 03:20:59 +11:00 committed by GitHub
parent f97a015cf9
commit 48ce49260d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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