Cancel if the User fetch resulted in a 410

This commit is contained in:
Mark Felder 2024-08-28 16:04:12 -04:00
parent 60101e240d
commit 66e1b40895

View file

@ -65,6 +65,12 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do
status: 404,
body: ""
}
%{url: "https://springfield.social/users/hankscorpio"} ->
%Tesla.Env{
status: 410,
body: ""
}
end)
end
@ -101,6 +107,23 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do
assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
end
test "when request returns a 410" do
params =
insert(:note_activity).data
|> Map.put("actor", "https://springfield.social/users/hankscorpio")
{:ok, oban_job} =
Federator.incoming_ap_doc(%{
method: "POST",
req_headers: [],
request_path: "/inbox",
params: params,
query_string: ""
})
assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
end
end
test "it can validate the signature" do