RocketChat / RocketChat/Rocket.Chat
Unread always 0 for channels in iFrame event unread-changed-by-subscription
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Context:
I am recreating a chat interface around the embedded iFrame. So I am heavily using the rest API and iFrame events. This specific issue prevent my users from being notified in a real time way of a new message in a channel.
Description:
On receive the iFrame event unread-changed-by-subscription, if the property "t" equal "c", meaning that the event received is about a channel, unread property will always be 0.
Note that unread is set correctly if the property "t" equal "d", for direct messages.
=> So it seems that the unread property from unread-changed-by-subscription event is broken for channels but works for direct messages.
Steps to reproduce:
- Create a channel (Not a direct message) with user A and B
- Connect with user A, send a message to the channel created before
- Connect with user B, see the event unread-changed-by-subscription coming in but unread is still 0.
Documentation: https://developer.rocket.chat/guides/developer/iframe-integration/iframe-events
Expected behavior:
I expect unread property to be set correctly on receive unread-changed-by-subscription for channels.
Actual behavior:
The unread property in the event data we receive on unread-changed-by-subscription remains at 0 at all times.
Server Setup Information:
- Version of Rocket.Chat Server: 3.16.1 and 3.16.3
- Operating System: Manjaro
- Deployment Method: docker-compose
- Number of Running Instances: 1
- Database Migration: 226
- NodeJS Version: 12.22.1
- MongoDB Version: 4.0.25
Client Setup Information
- Desktop App or Browser Version: 87.0.4280.88
- Operating System: Manjaro
Thank you
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
Reproduce the issue with a channel and a direct message using the documented unread-changed-by-subscription iFrame event. Compare the event data for channel and direct-message subscriptions, then trace where the unread value is produced. Done means channel events report the correct unread count, matching the expected behavior described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100