logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: d62a9afed3fe08aeaf9d2d9f0ca79736a1f24578
parent b8503f1ad412df72af2dc2d975d29e8810143667
Author: Mark Felder <feld@feld.me>
Date:   Sat, 20 Jul 2024 21:52:57 -0400

Improved detecting unrecoverable errors for incoming federation jobs

Diffstat:

Achangelog.d/oban-cancel-receiverworker.change1+
Mlib/pleroma/workers/receiver_worker.ex10++++++----
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/changelog.d/oban-cancel-receiverworker.change b/changelog.d/oban-cancel-receiverworker.change @@ -0,0 +1 @@ +Improved detecting unrecoverable errors for incoming federation jobs diff --git a/lib/pleroma/workers/receiver_worker.ex b/lib/pleroma/workers/receiver_worker.ex @@ -47,11 +47,13 @@ defmodule Pleroma.Workers.ReceiverWorker do case errors do {:error, :origin_containment_failed} -> {:cancel, :origin_containment_failed} {:error, :already_present} -> {:cancel, :already_present} - {:error, {:validate_object, reason}} -> {:cancel, reason} - {:error, {:error, {:validate, reason}}} -> {:cancel, reason} - {:error, {:reject, reason}} -> {:cancel, reason} + {:error, {:validate_object, _} = reason} -> {:cancel, reason} + {:error, {:validate, _} = reason} -> {:cancel, reason} + {:error, {:reject, _} = reason} -> {:cancel, reason} {:signature, false} -> {:cancel, :invalid_signature} - {:error, {:error, reason = "Object has been deleted"}} -> {:cancel, reason} + {:error, "Object has been deleted"} = reason -> {:cancel, reason} + {:error, {:side_effects, {:error, :no_object_actor}} = reason} -> {:cancel, reason} + {:error, :not_found} = reason -> {:cancel, reason} {:error, _} = e -> e e -> {:error, e} end