Skip to content

FEP-f228: Backfilling conversations

Authors Status Type Date received Tracking issue Discussions Repository
silverpill @silverpill@mitra.social DRAFT implementation 2025-02-17 #500 Discussions codeberg

Summary

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 and stops working if any node in the reply tree becomes inaccessible.

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.

Requirements

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.

Collection of posts

The items of this collection are attributed objects, such as Note or Article objects. It represents a thread, as seen 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. When a reply is deleted by its author, the sub-replies MAY remain in the thread collection.

Note

ActivityPub requires ordered collections to be presented in reverse chronological order. However, an erratum was proposed to relax this requirement.

Collection of activities

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.

contextHistory property is used to make a reference from a top-level post to related collection of activities.

Note

The collection of conversation activities was originally a part of Conversation Containers proposal.

Reading collections

After top-level post of a conversation is discovered, the whole conversation can be retrieved using the following algorithm:

  • If contextHistory property is present, retrieve collection of activities and stop.
  • If context property is present, retrieve collection of posts and stop.
  • If replies property is present, retrieve collection of replies, and repeat this step for every reply.

Implementations

Collection of posts:

Collection of activities:

  • Streams
  • Hubzilla
  • Forte

References

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.