Convert remaining JSON.generate (#38240)

This commit is contained in:
Matt Jankowski
2026-03-16 13:18:16 -04:00
committed by GitHub
parent 16c41e035b
commit 653161fecc
6 changed files with 6 additions and 6 deletions

View File

@@ -440,7 +440,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
def forward_for_reply
return unless @status.distributable? && @json['signature'].present? && reply_to_local?
ActivityPub::RawDistributionWorker.perform_async(Oj.dump(@json), replied_to_status.account_id, [@account.preferred_inbox_url])
ActivityPub::RawDistributionWorker.perform_async(JSON.generate(@json), replied_to_status.account_id, [@account.preferred_inbox_url])
end
def increment_voters_count!

View File

@@ -40,7 +40,7 @@ class ActivityPub::Activity::FeatureRequest < ActivityPub::Activity
end
def queue_delivery!(collection_item, serializer)
json = Oj.dump(serialize_payload(collection_item, serializer))
json = JSON.generate(serialize_payload(collection_item, serializer))
ActivityPub::DeliveryWorker.perform_async(json, @featured_account.id, @account.inbox_url)
end
end

View File

@@ -20,7 +20,7 @@ class ActivityPub::Forwarder
private
def payload
@payload ||= Oj.dump(@json)
@payload ||= JSON.generate(@json)
end
def reblogged_by_account_ids

View File

@@ -10,7 +10,7 @@ class Webhooks::PayloadRenderer
def get(path)
value = @document.dig(*parse_path(path))
string = Oj.dump(value)
string = JSON.generate(value)
# We want to make sure people can use the variable inside
# other strings, so it can't be wrapped in quotes.

View File

@@ -61,7 +61,7 @@ class Scheduler::SelfDestructScheduler
adapter: ActivityPub::Adapter
).as_json
json = Oj.dump(ActivityPub::LinkedDataSignature.new(payload).sign!(account))
json = JSON.generate(ActivityPub::LinkedDataSignature.new(payload).sign!(account))
ActivityPub::DeliveryWorker.push_bulk(inboxes, limit: 1_000) do |inbox_url|
[json, account.id, inbox_url]

View File

@@ -99,7 +99,7 @@ namespace :emojis do
map = map.sort { |a, b| a[0].size <=> b[0].size }.to_h
File.write(dest, Oj.dump(map))
File.write(dest, JSON.dump(map))
puts "Wrote emojo to destination! (#{dest})"
end