Soft-deletes and restoring deleted posts

Hi!

We are currently working on improvements to Mastodon moderation, and one feature we’re working on is the ability to appeal moderation actions, with the possibility for them to be overruled.

But we do have an issue with post deletion, where currently, post deletion is irrevocable, as a Delete permanently invalidates a post identifier in Mastodon, to address two different concerns:

  • out-of-order messages (Delete then Create received out of order because of network issues, relayed messages, etc.)
  • malicious replay of a Create activity for content that has been deleted by its author (since we use Linked-Data Signatures, the Create could possibly be replayed)

I’m not sure how we could handle that situation better, but we probably need some protocol change here. One idea would be to use an activity of the form

{
  "type": "Undo",
  "object": {
    "type": "Delete",
    "object": {
      "type": "Note",
        …
      },
    },
  },
}

It would still be possible to replay the Undo if for some reason the post was deleted, un-deleted and re-deleted again, but that case seem much rarer than the previous case.

Feedback is welcome, as, however rare that situation (a moderator deleting the post and then the decision being overruled), it would be damageable if different parts of the fediverse disagreed on whether the post has been permanently deleted.

Set/send an updated timestamp and ignore updates to any activity that happened prior to the most recently processed update. We also use this mechanism for ensuring we don’t get post/comment edits out of order.

1 Like

Makes sense, thanks. I will investigate it!

Is there an issue where this is being tracked?

This seems like a great example of where a protocol doc could help implementations converge on mutually beneficial rules.

As far as Mastodon is concerned, there’s https://github.com/mastodon/mastodon/issues/17553