WIP: Fix local user deletion outgoing federation #7974

Draft
phnt wants to merge 2 commits from fix-user-del-federation into develop
Member

Do not merge for next release: This is unfinished, untested and digs into the federation core. The bug has been there for years, it can wait a little bit ;)

  • Introduces a new flag unrestrict_deactivated to PublisherWorker, which overwrites the default filter for Activity search only for activated users
    • Rationale: In most cases the restriction on activated users is there for a reason; no reason to federate something from a deactivated account. Since the jobs run async, a user could delete their account right after posting and the two jobs could race, possibly leading to inconsistent deletion on remote instances. The user deletion ensures that the user is deactivated immediately.

Checklist

  • Adding a changelog: In the changelog.d directory, create a file named <code>.<type>.

Closes: 7957

**Do not merge for next release: This is unfinished, untested and digs into the federation core. The bug has been there for years, it can wait a little bit ;)** * Introduces a new flag `unrestrict_deactivated` to `PublisherWorker`, which overwrites the default filter for Activity search only for activated users * Rationale: In most cases the restriction on activated users is there for a reason; no reason to federate something from a deactivated account. Since the jobs run async, a user could delete their account right after posting and the two jobs could race, possibly leading to inconsistent deletion on remote instances. The user deletion ensures that the user is deactivated *immediately*. ### Checklist - [x] Adding a changelog: In the `changelog.d` directory, create a file named `<code>.<type>`. <!-- `<code>` can be anything, but we recommend using a more or less unique identifier to avoid collisions, such as the branch name. `<type>` can be `add`, `change`, `remove`, `fix`, `security` or `skip`. `skip` is only used if there is no user-visible change in the PR (for example, only editing comments in the code). Otherwise, choose a type that corresponds to your change. In the file, write the changelog entry. For example, if a PR adds group functionality, we can create a file named `group.add` and write `Add group functionality` in it. If one changelog entry is not enough, you may add more. But that might mean you can split it into two PRs. Only use more than one changelog entry if you really need to (for example, when one change in the code fix two different bugs, or when refactoring). --> Closes: 7957
When we are in the process of deleting a user, the user is already
deactivated before the job is executed. Adds a flag to the worker that
overrides the default Activity search restriction only to activated
users.
changelog
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
1852918141
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.19 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix-user-del-federation:fix-user-del-federation
git switch fix-user-del-federation

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff fix-user-del-federation
git switch fix-user-del-federation
git rebase develop
git switch develop
git merge --ff-only fix-user-del-federation
git switch fix-user-del-federation
git rebase develop
git switch develop
git merge --no-ff fix-user-del-federation
git switch develop
git merge --squash fix-user-del-federation
git switch develop
git merge --ff-only fix-user-del-federation
git switch develop
git merge fix-user-del-federation
git push origin develop
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma!7974
No description provided.