diff --git a/changelog.d/oban-cancel-receiverworker.change b/changelog.d/oban-cancel-receiverworker.change new file mode 100644 index 000000000..70ad22d60 --- /dev/null +++ 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 index 8b2052c23..cf1269a1f 100644 --- 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