The most common conversation backfill method is based on recursive retrieval of posts indicated by inReplyTo
property and posts contained in replies
collections. This is inefficient.
FEP-7888: Demystifying the context property suggests using the context
property for grouping related objects (such as posts in a conversation). This property can resolve to a collection, which can be used for efficient backfilling without recursion.
Two different implementations of context
collection exist: collection of posts and collection of activities.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC-2119.
This collection represents a thread and contains all posts in a conversation, from the perspective of the conversation owner.
It is an OrderedCollection
, and the order of items is chronological. It MUST contain at least one item, the top-level post. This post MUST have a context
property referring to the collection. Other posts might not have this property.
When context
property is present on a post, it MUST resolve to a collection of posts.
There is a difference between contents of this collection and a reply tree defined by inReplyTo
and replies
relationships, because conversation owner might choose to not include certain replies.
This collection contains all activities related to posts in a conversation, including but not limited to:
Create
Update
Delete
Like
It is an OrderedCollection
, and the order of items is chronological. It MUST contain at least one item, the Create
activity for the top-level post. This activity MUST have a context
property referring to the collection. Other activities might not have this property.
When context
property is present on an activity, it MUST resolve to a collection of activities.
In Conversation Containers this collection would coincide with the conversation container. It will contain Add
activities in addition to other activities.
history
propertyCollections described in this document can be implemented separately.
If both of them are implemented, the history
property can be added to a collection of posts, indicating a corresponding collection of activities. This property is defined in FEP-bad1: Object history collection, although the use case here differs from the one described in that proposal.
contextHistory
propertycontextHistory
property can be used to make a reference from a post to a collection of activities.
After top-level post of a conversation is discovered, the whole conversation can be retrieved using the following algorithm:
contextHistory
property is present, retrieve collection of activities and stop.context
property is present, retrieve collection of posts and stop.replies
property is present, retrieve collection of replies, and repeat this step for every reply.Collection of posts:
Collection of activities:
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
To the extent possible under law, the authors of this Fediverse Enhancement Proposal have waived all copyright and related or neighboring rights to this work.