Extend soft delete to draft, pending, and private post statuses#2860
Open
Extend soft delete to draft, pending, and private post statuses#2860
Conversation
When a federated post is changed to draft or pending status, send a Delete activity to unfederate the content. This follows the same soft delete pattern as visibility changes to local/private (FEP-4f05). Changes: - Update scheduler to trigger Delete for draft/pending status changes - Update is_post_disabled() to handle draft/pending for federated posts - Mark placeholder content in transformer as deprecated - Add tests for draft/pending soft delete behavior
Also include WordPress private post status in soft delete handling, alongside draft and pending.
The handler tests were creating draft posts, which are now disabled for ActivityPub interactions after the soft delete changes. Update tests to create published posts instead.
When a soft-deleted post is re-published before the Delete activity is sent, the pending Delete should be invalidated. This prevents sending both Delete and Create activities for the same re-published post.
Member
Author
|
Blocked by: mastodon/mastodon#37730 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes:
Extends the soft delete functionality (FEP-4f05) to also send Delete activities when a federated post's status is changed to "draft", "pending", or "private". Previously, changing a post to draft would send an Update activity with placeholder content "(This post is being modified)". Now it sends a proper Delete activity and returns a Tombstone, consistent with other soft delete scenarios.
Changes
is_post_disabled()to handle draft/pending/private statuses for federated postsinvalidate_existing_items()to invalidate pending Delete activities when Create/Update is added (prevents sending Delete after re-publish)Soft Delete Behavior
When a federated post is changed to draft/pending/private:
Re-publish Handling
When a soft-deleted post is re-published:
This follows the same pattern as visibility changes to local/private from #2824.
Other information:
Testing instructions:
Soft Delete
activitypub_statusmeta is set to "deleted"Re-publishing (before Delete is sent)
Re-publishing (after Delete is sent)
Changelog entry
Changelog entry has been added manually.