From dca266714d520cfb0fbd36460c7a898573fac33a Mon Sep 17 00:00:00 2001 From: f Date: Wed, 21 Feb 2024 17:08:11 -0300 Subject: [PATCH] fix: no completar el contenido si el objeto tiene actividades canceladas --- app/jobs/activity_pub/fetch_job.rb | 2 ++ app/models/activity_pub.rb | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/activity_pub/fetch_job.rb b/app/jobs/activity_pub/fetch_job.rb index e5950c86..ec8c29f7 100644 --- a/app/jobs/activity_pub/fetch_job.rb +++ b/app/jobs/activity_pub/fetch_job.rb @@ -11,6 +11,8 @@ class ActivityPub class FetchJob < ApplicationJob def perform(site:, object:) ActivityPub::Object.transaction do + return if object.activity_pubs.where(aasm_state: 'removed').count.positive? + response = site.social_inbox.dereferencer.get(uri: object.uri) # @todo Fallar cuando la respuesta no funcione? diff --git a/app/models/activity_pub.rb b/app/models/activity_pub.rb index 7e5bcabe..df8e5c5c 100644 --- a/app/models/activity_pub.rb +++ b/app/models/activity_pub.rb @@ -38,8 +38,6 @@ class ActivityPub < ApplicationRecord event :remove do transitions to: :removed - # @todo Es posible que haya un ActivityPub::FetchJob pendiente - # cuando estamos haciendo esto, que rellene el objeto después. before do object.update(content: {}) unless object.content.empty? end