Allow pin data fetching to fail
This commit is contained in:
parent
cc858f6d74
commit
f502954f16
2 changed files with 13 additions and 0 deletions
|
@ -1792,6 +1792,11 @@ def pin_data_from_featured_collection(
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pin_data_from_featured_collection(obj) do
|
||||||
|
Logger.error("Could not parse featured collection #{inspect(obj)}")
|
||||||
|
%{}
|
||||||
|
end
|
||||||
|
|
||||||
def fetch_and_prepare_featured_from_ap_id(nil) do
|
def fetch_and_prepare_featured_from_ap_id(nil) do
|
||||||
{:ok, %{}}
|
{:ok, %{}}
|
||||||
end
|
end
|
||||||
|
|
|
@ -2629,6 +2629,14 @@ test "allow fetching of accounts with an empty string name field" do
|
||||||
assert user.name == " "
|
assert user.name == " "
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "pin_data_from_featured_collection will ignore unsupported values" do
|
||||||
|
assert %{} ==
|
||||||
|
ActivityPub.pin_data_from_featured_collection(%{
|
||||||
|
"type" => "CollectionThatIsNotRealAndCannotHurtMe",
|
||||||
|
"first" => "https://social.example/users/alice/collections/featured?page=true"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
describe "persist/1" do
|
describe "persist/1" do
|
||||||
test "should not persist remote delete activities" do
|
test "should not persist remote delete activities" do
|
||||||
poster = insert(:user, local: false)
|
poster = insert(:user, local: false)
|
||||||
|
|
Loading…
Reference in a new issue