ActivityPub/Primer/Server-Managed Collections

From W3C Wiki

ActivityPub defines a number of Collection properties that are related to an Actor:

  • followers - a collection of all actors that follow this actor
  • following - a collection of all actors this actor follows
  • liked - a collection of all objects the actor has liked

It also defines a number of Collection properties related to all objects:

  • likes - a collection of all Like activities applied to this object
  • shares - a collection of all Announce activities applied to this object
  • replies - a collection of all objects with this object as an inReplyTo property

These collections are primarily managed by the server.

The user can add to the collections by executing the related activities: Follow, Like, Announce, and Create with an inReplyTo property. The user can remove from the collections using the appropriate Undo activity.

As a best practice, client software should not execute activities that directly manipulate these properties. Some best practices:

  • Do not try to replace these properties with other values using an Update activity
  • Do not try to delete these collections using a Delete activity
  • Do not try to add to the collections using a Add activity
  • Do not try to remove objects from the collections using a Remove activity (but see "Moderation" below)

These collections may have internal representations that are much different than the data structures used in the API. The servers may manage these internal representations much differently than clients would manage a Collection.

Server software should check for these conditions and reject client activities that try to directly manipulate these collections.

Moderation

One use-case for using Remove on one of the server-managed collections is for moderation; especially for the collections that hold activities initiated by other users. For example, a Note in a replies collection may be inappropriate; a Remove activity by the original author or a moderator would be useful in this case. This would not necessarily delete the inappropriate Note, but simply remove it from the collection. These collections are under the control of the original author and moderators of their server and are not necessarily a complete list of all replies. Similarly for likes and shares.