logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 5f5bd64b83d3158871c20ff53044102208e272a8
parent 94d7e28cbe36609c94bef1c8e6edd1853659d716
Author: Mark Felder <feld@feld.me>
Date:   Sat, 27 Jan 2024 14:54:07 -0500

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

Diffstat:

Mlib/pleroma/web/activity_pub/side_effects.ex15+++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex @@ -304,9 +304,9 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do 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 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do {: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{} ->