Pleroma.Web.ActivityPub.SideEffects: dialyzer errors

lib/pleroma/web/activity_pub/side_effects.ex:544:call
The function call will not succeed.

Pleroma.Web.ActivityPub.SideEffects.delete_object(
  _object :: %Pleroma.Activity{
    :__meta__ => _,
    :actor => _,
    :bookmark => _,
    :data => map(),
    :id => _,
    :inserted_at => _,
    :local => _,
    :notifications => _,
    :object => _,
    :pagination_id => _,
    :recipients => _,
    :report_notes => _,
    :thread_muted? => _,
    :updated_at => _,
    :user_actor => _
  }
)

breaks the contract
(Pleroma.Object.t()) :: :ok | {:error, Ecto.Changeset.t()}
This commit is contained in:
Mark Felder 2024-01-27 15:05:12 -05:00
parent b6a1e7fb31
commit 5c193a34a2

View file

@ -580,7 +580,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
def handle_undoing(object), do: {:error, ["don't know how to handle", object]}
@spec delete_object(Object.t()) :: :ok | {:error, Ecto.Changeset.t()}
@spec delete_object(Activity.t()) :: :ok | {:error, Ecto.Changeset.t()}
defp delete_object(object) do
with {:ok, _} <- Repo.delete(object), do: :ok
end