5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 01:26:22 +00:00

fix: pedir locks antes de guardar

closes #15621

closes #15622

closes #15623

closes #15729

closes #15730

closes #15731

closes #15735

closes #15736
This commit is contained in:
f 2024-03-22 11:53:23 -03:00
parent ad637189b5
commit 4853263374
No known key found for this signature in database

View file

@ -66,6 +66,7 @@ class ActivityPub
@object ||= ::ActivityPub::Object.lock.find_or_initialize_by(uri: object_uri).tap do |o| @object ||= ::ActivityPub::Object.lock.find_or_initialize_by(uri: object_uri).tap do |o|
o.content = original_object if object_embedded? o.content = original_object if object_embedded?
o.lock!
o.save! o.save!
# XXX: el objeto necesita ser guardado antes de poder # 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| .find_or_initialize_by(uri: original_activity[:id], activity_pub: activity_pub, actor: actor).tap do |a|
a.content = original_activity.dup a.content = original_activity.dup
a.content[:object] = object.uri a.content[:object] = object.uri
a.lock!
a.save! a.save!
end end
end end
@ -113,6 +115,7 @@ class ActivityPub
site.instance_moderations.lock.find_or_create_by(instance: a.instance) site.instance_moderations.lock.find_or_create_by(instance: a.instance)
a.lock!
a.save! a.save!
site.actor_moderations.lock.find_or_create_by(actor: a) site.actor_moderations.lock.find_or_create_by(actor: a)