ActivityPub/Primer/Delete activity

From W3C Wiki

Server to server

The Delete activity is how objects on the ActivityPub network are deleted.

Here are some important checks that implementers should make when they receive a Delete activity:

  • Check that the object exists. If not, the Delete activity can be safely ignored.
  • Check that the object's creator is the same as the actor for the Delete activity. This could be stored in a number of ways; the attributedTo property may be used for this check.
  • Check that the object has not already been deleted. If you are using the Tombstone pattern to mark deleted objects, make sure that the type of the object is not already Tombstone.

When deleting, here are some typical actions to take:

  • Replace the representation of the object with a Tombstone object. This makes it less necessary to remove the object from any collections. For example, if the object has already been added to hundreds of inbox collections, you don't have to remove it from each one; it can be filtered out when the collection is read.
  • Remove any collections related to the object -- particularly likes and shares. This keeps the collections from being orphaned.
  • Remove any cached media, such as images, video, audio, etc.

References