Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Feb 2, 2026

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

  • Update scheduler to trigger Delete for draft/pending/private status changes (same as trash)
  • Update is_post_disabled() to handle draft/pending/private statuses for federated posts
  • Mark placeholder content in transformer as deprecated (kept for backwards compatibility)
  • Update invalidate_existing_items() to invalidate pending Delete activities when Create/Update is added (prevents sending Delete after re-publish)
  • Add tests for draft/pending/private soft delete behavior
  • Fix handler tests to use published posts

Soft Delete Behavior

When a federated post is changed to draft/pending/private:

  1. Delete activity is sent to followers
  2. Post state is set to "deleted"
  3. URL is registered in tombstone registry
  4. Accessing the ActivityPub URL returns 200 OK with Tombstone (soft delete)

Re-publish Handling

When a soft-deleted post is re-published:

  1. Any pending Delete activity is invalidated (won't be sent)
  2. Create activity is sent instead
  3. Tombstone is removed from registry

This follows the same pattern as visibility changes to local/private from #2824.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

Soft Delete

  1. Create and publish a post (it will be federated)
  2. Wait for the post to be federated (check outbox or wait for cron)
  3. Edit the post and change status to "Draft", "Pending Review", or "Private"
  4. Verify that a Delete activity is created in the outbox
  5. Verify the post's activitypub_status meta is set to "deleted"
  6. Query the post's ActivityPub URL - should return 200 with Tombstone

Re-publishing (before Delete is sent)

  1. Create and publish a post
  2. Quickly change to Draft (Delete activity scheduled but not sent)
  3. Immediately re-publish the post
  4. Verify the Delete activity is invalidated (status changed to publish)
  5. Verify a Create activity is pending

Re-publishing (after Delete is sent)

  1. Take a soft-deleted post (status changed to Draft/Pending/Private)
  2. Wait for Delete activity to be sent
  3. Publish the post again
  4. Verify a Create activity is created in the outbox
  5. Verify the tombstone is removed

Changelog entry

Changelog entry has been added manually.

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
Copilot AI review requested due to automatic review settings February 2, 2026 17:46
@pfefferle pfefferle self-assigned this Feb 2, 2026
@pfefferle pfefferle requested a review from a team February 2, 2026 17:46
Also include WordPress private post status in soft delete handling,
alongside draft and pending.
@pfefferle pfefferle changed the title Extend soft delete to draft and pending post statuses Extend soft delete to draft, pending, and private post statuses Feb 2, 2026
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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.
@pfefferle
Copy link
Member Author

Blocked by: mastodon/mastodon#37730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant