commit: 948d5a93a0063fec39b6d578bc39766f43087f8e
parent 2062e126f11019c0b981fe92cebfbe32dbbc1261
Author: Mark Felder <feld@feld.me>
Date: Sat, 27 Jan 2024 13:58:50 -0500
Pleroma.Object: dialyzer error
lib/pleroma/object.ex:245:call
The function call will not succeed.
Pleroma.Object.cleanup_attachments(any(), %{<<_::48>> => %Pleroma.Object{:data => map(), atom() => _}})
breaks the contract
(boolean(), %{:object => map()}) :: {:ok, Oban.Job.t() | nil}
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex
@@ -242,17 +242,17 @@ defmodule Pleroma.Object do
{:ok, _} <- invalid_object_cache(object) do
cleanup_attachments(
Config.get([:instance, :cleanup_attachments]),
- %{"object" => object}
+ object
)
{:ok, object, deleted_activity}
end
end
- @spec cleanup_attachments(boolean(), %{required(:object) => map()}) ::
+ @spec cleanup_attachments(boolean(), Object.t()) ::
{:ok, Oban.Job.t() | nil}
- def cleanup_attachments(true, %{"object" => _} = params) do
- AttachmentsCleanupWorker.enqueue("cleanup_attachments", params)
+ def cleanup_attachments(true, %Object{} = object) do
+ AttachmentsCleanupWorker.enqueue("cleanup_attachments", %{"object" => object})
end
def cleanup_attachments(_, _), do: {:ok, nil}