[#3213] ActivityPub: fixed subquery-based hashtags filtering implementation (addressed empty list options issue). Added regression test.

This commit is contained in:
Ivan Tashkinov 2021-01-31 23:06:38 +03:00
commit cf4765af40
2 changed files with 68 additions and 60 deletions

View file

@ -249,6 +249,17 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
limit: 2
})
fetch_six =
ActivityPub.fetch_activities([], %{
type: "Create",
tag: ["any1", "any2"],
tag_all: [],
tag_reject: []
})
# Regression test: passing empty lists as filter options shouldn't affect the results
assert fetch_five == fetch_six
[fetch_one, fetch_two, fetch_three, fetch_four, fetch_five] =
Enum.map([fetch_one, fetch_two, fetch_three, fetch_four, fetch_five], fn statuses ->
Enum.map(statuses, fn s -> Repo.preload(s, object: :hashtags) end)