From 48532633740028bf406d2bd7ca97ab85f9c076bd Mon Sep 17 00:00:00 2001 From: f Date: Fri, 22 Mar 2024 11:53:23 -0300 Subject: [PATCH] fix: pedir locks antes de guardar closes #15621 closes #15622 closes #15623 closes #15729 closes #15730 closes #15731 closes #15735 closes #15736 --- app/jobs/activity_pub/process_job.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/jobs/activity_pub/process_job.rb b/app/jobs/activity_pub/process_job.rb index f3aeebb4..bd010613 100644 --- a/app/jobs/activity_pub/process_job.rb +++ b/app/jobs/activity_pub/process_job.rb @@ -66,6 +66,7 @@ class ActivityPub @object ||= ::ActivityPub::Object.lock.find_or_initialize_by(uri: object_uri).tap do |o| o.content = original_object if object_embedded? + o.lock! o.save! # XXX: el objeto necesita ser guardado antes de poder @@ -95,6 +96,7 @@ class ActivityPub .find_or_initialize_by(uri: original_activity[:id], activity_pub: activity_pub, actor: actor).tap do |a| a.content = original_activity.dup a.content[:object] = object.uri + a.lock! a.save! end end @@ -113,6 +115,7 @@ class ActivityPub site.instance_moderations.lock.find_or_create_by(instance: a.instance) + a.lock! a.save! site.actor_moderations.lock.find_or_create_by(actor: a)