5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 15:46:21 +00:00

fix: serializar correctamente

closes #15363
This commit is contained in:
f 2024-03-13 16:11:40 -03:00
parent 882ab1679c
commit 56c583e0f4
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -125,8 +125,9 @@ module Api
o.save! o.save!
# XXX: el objeto necesita ser guardado antes de poder # XXX: el objeto necesita ser guardado antes de poder
# procesarlo # procesarlo. No usamos GlobalID porque el tipo de objeto
::ActivityPub::FetchJob.perform_later(site: site, object: o) unless object_embedded? # cambia y produce un error de deserialización.
::ActivityPub::FetchJob.perform_later(site: site, object_id: o.id) unless object_embedded?
end end
end end

View file

@ -11,8 +11,11 @@ class ActivityPub
class FetchJob < ApplicationJob class FetchJob < ApplicationJob
self.priority = 50 self.priority = 50
def perform(site:, object:) def perform(site:, object_id:)
ActivityPub::Object.transaction do ActivityPub::Object.transaction do
object = ::ActivityPub::Object.find(object_id)
return if object.blank?
return if object.activity_pubs.where(aasm_state: 'removed').count.positive? return if object.activity_pubs.where(aasm_state: 'removed').count.positive?
response = site.social_inbox.dereferencer.get(uri: object.uri) response = site.social_inbox.dereferencer.get(uri: object.uri)