Fix thread-unsafe ActivityPub activity dispatch (#37423)

This commit is contained in:
Joshua Rogers authored and GitHub committed 2026-01-09 16:20:59 +00:00
1 parent f97a015cf9
commit 48ce49260d
1 file changed
+3 -4
+3 -4
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'