fedify icon indicating copy to clipboard operation
fedify copied to clipboard

`@fedify/backfill` package for FEP-f228 conversation backfill

Open dahlia opened this issue 5 months ago • 1 comments

The “quiet fediverse” problem occurs when users see incomplete conversations due to the distributed nature of ActivityPub. Currently, most implementations use reply tree crawling (recursively fetching inReplyTo chains), which can be inefficient and may miss replies.

FEP-f228: Backfilling conversations proposes a more efficient approach where conversation owners provide resolvable context properties that resolve to OrderedCollections containing the entire conversation thread.

Proposal

Create a new @fedify/backfill package that implements conversation backfilling with multiple strategies:

  1. FEP-f228 context owner approach (primary): Check if context resolves to an OrderedCollection
  2. Reply tree crawling (fallback): Traditional recursive fetching via inReplyTo
  3. Hybrid approach: Combine both methods for maximum coverage
import { backfill } from "@fedify/backfill";

const conversation = await Array.fromAsync(
  backfill(context, note, {
    strategies: ["context-owner", "reply-tree-crawl"],
  })
);

Use cases

  • ActivityPub servers wanting to display complete conversations
  • Clients needing to backfill missing replies
  • Bridge implementations between different fediverse platforms

Implementation considerations

  • Should work with any Fedify-based application
  • Configurable strategies and fallback mechanisms
  • Efficient deduplication and caching
  • Rate limiting and error handling for external fetches

Related

dahlia avatar Jul 03 '25 15:07 dahlia

To be completely technically correct, this would be an implementation of 7888/f228 😄 — the former describes the resolvable OrderedCollection served via context, and the latter describes the actual backfill mechanism.

I am 100% on board with mixing and matching strategies for full effect. Should a context not be present or unresolvable, it makes complete sense to fall back to inReplyTo traversal. This is what NodeBB does.

julianlam avatar Jul 03 '25 18:07 julianlam