Changelog + remove some unneeded comments from the tests

This commit is contained in:
ilja 2023-01-23 09:43:16 +01:00
parent c1c962e1a8
commit 328b4d93b7
2 changed files with 3 additions and 12 deletions

View file

@ -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

View file

@ -416,7 +416,6 @@ test "We don't have unexpected tables which may contain objects that are referen
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 @@ test "it prunes orphaned activities with the --prune-orphaned-activities" do
})
|> Repo.insert()
# Add a remote activity which references an activity
%Activity{}
|> Map.merge(%{
local: false,
@ -437,7 +435,6 @@ test "it prunes orphaned activities with the --prune-orphaned-activities" do
})
|> Repo.insert()
# Add a remote activity which references an Actor
%User{} |> Map.merge(%{ap_id: "actor"}) |> Repo.insert()
%Activity{}
@ -447,7 +444,6 @@ test "it prunes orphaned activities with the --prune-orphaned-activities" do
})
|> Repo.insert()
# Add a remote activity without existing referenced object, activity or actor
%Activity{}
|> Map.merge(%{
local: false,
@ -458,7 +454,6 @@ test "it prunes orphaned activities with the --prune-orphaned-activities" do
})
|> Repo.insert()
# Add a local activity without existing referenced object, activity or actor
%Activity{}
|> Map.merge(%{
local: true,
@ -466,8 +461,6 @@ test "it prunes orphaned activities with the --prune-orphaned-activities" 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 @@ test "it prunes orphaned activities with the --prune-orphaned-activities when th
%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 @@ test "it prunes orphaned activities with the --prune-orphaned-activities when th
})
|> Repo.insert()
# Multiple objects, one actor exists (keep)
%Activity{}
|> Map.merge(%{
local: false,
@ -508,7 +499,6 @@ test "it prunes orphaned activities with the --prune-orphaned-activities when th
})
|> Repo.insert()
# Multiple objects, one activity exists (keep)
%Activity{}
|> Map.merge(%{
local: false,
@ -519,7 +509,6 @@ test "it prunes orphaned activities with the --prune-orphaned-activities when th
})
|> Repo.insert()
# Multiple objects none exist (prune)
%Activity{}
|> Map.merge(%{
local: false,