RocketChat / RocketChat/Rocket.Chat
PERFORMANCE: Starred Messages/Mentions tabs perform blocking sequential waterfalls
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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