Skip to content

Reverse MUC MAM catch-up direction to fetch recent messages first #298

@mremond

Description

@mremond

Summary

Currently, MUC room MAM catch-up after a long offline period uses forward pagination (oldest → newest from the last cached message). This means users see old messages loading first, and if the archive is very large, may never see the most recent messages before the page limit is hit.

1:1 chat catch-up already uses backward pagination (before: '' with start filter), which loads the most recent messages first. This is a better UX: the user immediately sees today's messages, and can scroll up to fill any remaining gap.

Proposed change

For v0.16.0, change queryRoomArchive() forward catch-up and fetchMAMForRoom() to use backward pagination with a start filter, matching the 1:1 chat pattern. The gap marker infrastructure (added in v0.15.1) already supports filling gaps via a "Load missing messages" button.

Files involved

  • packages/fluux-sdk/src/core/modules/MAM.tsqueryRoomArchive() pagination direction
  • packages/fluux-sdk/src/core/roomSideEffects.tsfetchMAMForRoom() query construction
  • packages/fluux-sdk/src/core/backgroundSync.tscatchUpAllRooms() query construction

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestplannedWe want to support this in an upcoming release.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions