From ddaee30da715981c9871728706450050ecbfd091 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 21 Feb 2024 15:44:16 -0300 Subject: [PATCH] fix: primero guardar el objeto antes de obtener su contenido --- .../api/v1/webhooks/social_inbox_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/webhooks/social_inbox_controller.rb b/app/controllers/api/v1/webhooks/social_inbox_controller.rb index c15a757d..24865c92 100644 --- a/app/controllers/api/v1/webhooks/social_inbox_controller.rb +++ b/app/controllers/api/v1/webhooks/social_inbox_controller.rb @@ -97,13 +97,13 @@ module Api # @return [ActivityPub::Object] def object @object ||= ActivityPub::Object.type_from(original_object).find_or_initialize_by(uri: object_uri).tap do |o| - if object_embedded? - o.content = original_object - else - ActivityPub::FetchJob.perform_later(site: site, object: o) - end + o.content = original_object if object_embedded? o.save! + + # XXX: el objeto necesita ser guardado antes de poder + # procesarlo + ActivityPub::FetchJob.perform_later(site: site, object: o) unless object_embedded? end end