RocketChat / RocketChat/Rocket.Chat

Differences in unread message counters for groups (Client/REST-API)

Open
#22,366 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

There seem to be some differences in the counting mechanisms for unread messages between the client and REST-API regarding groups.

Client:
The unread counter for groups does not consider system messages (like when a user is deleted from a group).

REST-API (https://developer.rocket.chat/api/rest-api/methods/groups/counters):
Receiving the number of unread messages for a user and a group via REST-API does consider system messages.

Steps to reproduce:
  1. Create a group with three users (A, B, C)
  2. Have user A remove user C from the group; Resulting in a system message (User C has been removed...)
  3. Write a message with user A in the group
  4. Check the unread counters of user B for the group
Expected behavior:

The logic for counting the unread messages should be the same. Either system messages are considered or not.

Actual behavior:

Unread counters of user B in the group:

  • In client it shows a 1.
  • Receiving the unread counter via REST-API for the user and group returns a 2.
Server Setup Information:
  • Version of Rocket.Chat Server: 3.15.0

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 the groups/counters REST API endpoint and reproduce the three-user group scenario described in the issue. Compare its unread count with the client count after the removal system message and subsequent user message; done means both paths consistently include or exclude system messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.