Pleroma.Web.ActivityPub.SideEffects: dialyzer errors

lib/pleroma/web/activity_pub/side_effects.ex:328:pattern_match
The pattern can never match the type.

Pattern:
{:actor, _}

Type:
{:error, boolean()}

lib/pleroma/web/activity_pub/side_effects.ex:328:pattern_match
The pattern can never match the type.

Pattern:
{:actor, _}

Type:
nil
This commit is contained in:
Mark Felder 2024-01-27 14:54:07 -05:00
parent 94d7e28cbe
commit 5f5bd64b83
1 changed files with 13 additions and 2 deletions

View File

@ -304,9 +304,9 @@ def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object,
result =
case deleted_object do
%Object{} ->
with {:ok, deleted_object, _activity} <- Object.delete(deleted_object),
with {_, {:ok, deleted_object, _activity}} <- {:object, Object.delete(deleted_object)},
{_, actor} when is_binary(actor) <- {:actor, deleted_object.data["actor"]},
%User{} = user <- User.get_cached_by_ap_id(actor) do
{_, %User{} = user} <- {:user, User.get_cached_by_ap_id(actor)} do
User.remove_pinned_object_id(user, deleted_object.data["id"])
{:ok, user} = ActivityPub.decrease_note_count_if_public(user, deleted_object)
@ -328,6 +328,17 @@ def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object,
{:actor, _} ->
@logger.error("The object doesn't have an actor: #{inspect(deleted_object)}")
:no_object_actor
{:user, _} ->
@logger.error(
"The object's actor could not be resolved to a user: #{inspect(deleted_object)}"
)
:no_object_user
{:object, _} ->
@logger.error("The object could not be deleted: #{inspect(deleted_object)}")
{:error, object}
end
%User{} ->