parent
bc265bfd54
commit
f5a315f04c
|
@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Task to manually run the transient prune job (pleroma.database prune\_task)
|
- Task to manually run the transient prune job (pleroma.database prune\_task)
|
||||||
- Ability to follow hashtags
|
- Ability to follow hashtags
|
||||||
- Option to extend `reject` in MRF-Simple to apply to entire threads, where the originating instance is rejected
|
- Option to extend `reject` in MRF-Simple to apply to entire threads, where the originating instance is rejected
|
||||||
|
- Extra information to failed HTTP requests
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
- MastoAPI: Accept BooleanLike input on `/api/v1/accounts/:id/follow` (fixes follows with mastodon.py)
|
- MastoAPI: Accept BooleanLike input on `/api/v1/accounts/:id/follow` (fixes follows with mastodon.py)
|
||||||
|
|
|
@ -68,7 +68,7 @@ defp fetch_page_items(id, items \\ []) do
|
||||||
items
|
items
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{:error, "Object has been deleted"} ->
|
{:error, {"Object has been deleted", _, _}} ->
|
||||||
items
|
items
|
||||||
|
|
||||||
{:error, error} ->
|
{:error, error} ->
|
||||||
|
|
|
@ -180,7 +180,7 @@ def fetch_object_from_id!(id, options \\ []) do
|
||||||
{:error, %Tesla.Mock.Error{}} ->
|
{:error, %Tesla.Mock.Error{}} ->
|
||||||
nil
|
nil
|
||||||
|
|
||||||
{:error, "Object has been deleted"} ->
|
{:error, {"Object has been deleted", _id, _code}} ->
|
||||||
nil
|
nil
|
||||||
|
|
||||||
{:reject, reason} ->
|
{:reject, reason} ->
|
||||||
|
@ -284,7 +284,7 @@ defp get_object(id) do
|
||||||
end
|
end
|
||||||
|
|
||||||
{:ok, %{status: code}} when code in [404, 410] ->
|
{:ok, %{status: code}} when code in [404, 410] ->
|
||||||
{:error, "Object has been deleted"}
|
{:error, {"Object has been deleted", id, code}}
|
||||||
|
|
||||||
{:error, e} ->
|
{:error, e} ->
|
||||||
{:error, e}
|
{:error, e}
|
||||||
|
|
|
@ -1711,7 +1711,7 @@ def fetch_and_prepare_user_from_ap_id(ap_id, additional \\ []) do
|
||||||
{:ok, maybe_update_follow_information(data)}
|
{:ok, maybe_update_follow_information(data)}
|
||||||
else
|
else
|
||||||
# If this has been deleted, only log a debug and not an error
|
# If this has been deleted, only log a debug and not an error
|
||||||
{:error, "Object has been deleted" = e} ->
|
{:error, {"Object has been deleted" = e, _, _}} ->
|
||||||
Logger.debug("Could not decode user at fetch #{ap_id}, #{inspect(e)}")
|
Logger.debug("Could not decode user at fetch #{ap_id}, #{inspect(e)}")
|
||||||
{:error, e}
|
{:error, e}
|
||||||
|
|
||||||
|
|
|
@ -216,14 +216,16 @@ test "all objects with fake directions are rejected by the object fetcher" do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "handle HTTP 410 Gone response" do
|
test "handle HTTP 410 Gone response" do
|
||||||
assert {:error, "Object has been deleted"} ==
|
assert {:error,
|
||||||
|
{"Object has been deleted", "https://mastodon.example.org/users/userisgone", 410}} ==
|
||||||
Fetcher.fetch_and_contain_remote_object_from_id(
|
Fetcher.fetch_and_contain_remote_object_from_id(
|
||||||
"https://mastodon.example.org/users/userisgone"
|
"https://mastodon.example.org/users/userisgone"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "handle HTTP 404 response" do
|
test "handle HTTP 404 response" do
|
||||||
assert {:error, "Object has been deleted"} ==
|
assert {:error,
|
||||||
|
{"Object has been deleted", "https://mastodon.example.org/users/userisgone404", 404}} ==
|
||||||
Fetcher.fetch_and_contain_remote_object_from_id(
|
Fetcher.fetch_and_contain_remote_object_from_id(
|
||||||
"https://mastodon.example.org/users/userisgone404"
|
"https://mastodon.example.org/users/userisgone404"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue