From 0cda0689184277c7e58ec021ab062c5a3e1d589b Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sat, 10 Jan 2026 03:20:59 +1100 Subject: [PATCH] Fix thread-unsafe ActivityPub activity dispatch (#37423) --- app/lib/activitypub/activity.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb index 64ee9acd0..d07d1c2f2 100644 --- a/app/lib/activitypub/activity.rb +++ b/app/lib/activitypub/activity.rb @@ -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'