From: ilja Date: Mon, 23 Jan 2023 08:43:16 +0000 (+0100) Subject: Changelog + remove some unneeded comments from the tests X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=328b4d93b750f181966b08bff048f0912e2ad6b3;p=akkoma Changelog + remove some unneeded comments from the tests --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da10fae4..0295b1860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased ## Fixed - - Allowed contentMap to be updated on edit +### Added +- Extend the mix task `prune_objects` with option `--prune-orphaned-activities` to also prune orphaned activities, allowing to reclaim even more database space + ## 2023.02 ### Added diff --git a/test/mix/tasks/pleroma/database_test.exs b/test/mix/tasks/pleroma/database_test.exs index 402856f3d..9edb2c115 100644 --- a/test/mix/tasks/pleroma/database_test.exs +++ b/test/mix/tasks/pleroma/database_test.exs @@ -416,7 +416,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do end test "it prunes orphaned activities with the --prune-orphaned-activities" do - # Add a remote activity which references an Object %Object{} |> Map.merge(%{data: %{"id" => "object_for_activity"}}) |> Repo.insert() %Activity{} @@ -426,7 +425,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Add a remote activity which references an activity %Activity{} |> Map.merge(%{ local: false, @@ -437,7 +435,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Add a remote activity which references an Actor %User{} |> Map.merge(%{ap_id: "actor"}) |> Repo.insert() %Activity{} @@ -447,7 +444,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Add a remote activity without existing referenced object, activity or actor %Activity{} |> Map.merge(%{ local: false, @@ -458,7 +454,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Add a local activity without existing referenced object, activity or actor %Activity{} |> Map.merge(%{ local: true, @@ -466,8 +461,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # The remote activities without existing reference, and only the remote activities without existing reference, are deleted - # if, and only if, we provide the --prune-orphaned-activities option assert length(Repo.all(Activity)) == 5 Mix.Tasks.Pleroma.Database.run(["prune_objects"]) assert length(Repo.all(Activity)) == 5 @@ -486,7 +479,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do %Object{} |> Map.merge(%{data: %{"id" => "existing_object"}}) |> Repo.insert() %User{} |> Map.merge(%{ap_id: "existing_actor"}) |> Repo.insert() - # Multiple objects, one object exists (keep) %Activity{} |> Map.merge(%{ local: false, @@ -497,7 +489,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Multiple objects, one actor exists (keep) %Activity{} |> Map.merge(%{ local: false, @@ -508,7 +499,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Multiple objects, one activity exists (keep) %Activity{} |> Map.merge(%{ local: false, @@ -519,7 +509,6 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # Multiple objects none exist (prune) %Activity{} |> Map.merge(%{ local: false,