RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.81k stars 10.74k forks source link

Unread always 0 for channels in iFrame event unread-changed-by-subscription #22714

Open julienchabanon opened 3 years ago

julienchabanon commented 3 years ago

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:

  1. Create a channel (Not a direct message) with user A and B
  2. Connect with user A, send a message to the channel created before
  3. 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:

Client Setup Information

Thank you

johncrisp commented 3 years ago

Hi.

Can you please test this on 3.17?

If it is still there we can raise it with the Product Team.

Thanks.