RocketChat / RocketChat/Rocket.Chat

PERFORMANCE: Starred Messages/Mentions tabs perform blocking sequential waterfalls

Open
#39,237 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: Request triaged type: bug type: feature valid
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

  • 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with StarredMessagesTab.tsx and MentionsTab.tsx, reading the useQuery hooks and their sequential pagination loops. Verify the current loading behavior, then make page 1 visible before later pages load and fetch subsequent pages as the user reaches the list bottom.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.