Skip to content

PERFORMANCE: Starred Messages/Mentions tabs perform blocking sequential waterfalls #39237

@iramsk02

Description

@iramsk02
  • The current implementation of StarredMessagesTab.tsx and MentionsTab.tsx fetches all historical records using a sequential for loop inside the useQuery hook.

  • This causes a blocking UI state where users cannot see any results until the server has responded to every single pagination request.

  • Actual Behavior:
    The code uses a loop like this:

for (let offset = 0, result = await getStarredMessages({ roomId, offset: 0 }); ...) {
    messages.push(...result.messages);
}

This means Page 2 cannot start loading until Page 1 is fully completed and mapped.

  • Expected Behavior:
  • The application should use Infinite Loading (Streaming).
  • Page 1 should be displayed as soon as it is available, and subsequent pages should only be fetched as the user reaches the bottom of the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugtype: featurePull requests that introduces new featurevalidA valid contribution where maintainers will review based on priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions