fix(retention): keep threads whose post a local user quoted
A quote has a context of its own, so the quoted remote thread counted as untouched and was evicted, breaking the local quote. On lain.com 45 of 134 quoted posts went this way. The objects_quote_url index keeps the lookup at one probe per post.
This commit is contained in:
parent
5e425ce9f5
commit
e93f05a79f
5 changed files with 53 additions and 5 deletions
|
|
@ -200,6 +200,29 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do
|
|||
refute Object.get_by_ap_id(old_remote_post2_id)
|
||||
end
|
||||
|
||||
test "with the --keep-threads option it keeps old threads a local user quoted", %{
|
||||
old_insert_date: old_insert_date
|
||||
} do
|
||||
remote_user = insert(:user, local: false)
|
||||
local_user = insert(:user)
|
||||
|
||||
{:ok, quoted} = CommonAPI.post(remote_user, %{status: "quote me"})
|
||||
|
||||
quoted
|
||||
|> Ecto.Changeset.change(%{local: false, updated_at: old_insert_date})
|
||||
|> Repo.update!()
|
||||
|
||||
{:ok, quote} = CommonAPI.post(local_user, %{status: "look", quote_id: quoted.id})
|
||||
|
||||
quote
|
||||
|> Ecto.Changeset.change(%{updated_at: old_insert_date})
|
||||
|> Repo.update!()
|
||||
|
||||
Mix.Tasks.Pleroma.Database.run(["prune_objects", "--keep-threads"])
|
||||
|
||||
assert Object.get_by_ap_id(quoted.data["object"])
|
||||
end
|
||||
|
||||
test "with the --keep-threads option it keeps old threads addressed to a local user", %{
|
||||
old_insert_date: old_insert_date
|
||||
} do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue