Rocket.chat: Unread bar not showing for livechat room

Created on 13 Dec 2018  路  8Comments  路  Source: RocketChat/Rocket.Chat

Description:

The unread bar is not shown when the first unread message out of the screen.

Steps to reproduce:

Visitor send a lot messages.

Expected behavior:

Unread bar (Mark as read bar) should be shown like this
unread-bar-shown

Actual behavior:

Unread bar (Mark as read bar) was not shown and unread messages were marked as read immediately.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.71.0

Additional context

It's because of in livechat room case, RoomManager open room by using type + id ( RoomManager.open(type + id) ),
https://github.com/RocketChat/Rocket.Chat/blob/e6d9375fe28abf907577a1e66220d23b6d2027c1/packages/rocketchat-livechat/imports/LivechatRoomType.js#L5-L16

and in readMessages it's using RoomManager.openedRooms[subscription.t + subscription.name]. It makes process not go further to keep unread bar showing.
https://github.com/RocketChat/Rocket.Chat/blob/e6d9375fe28abf907577a1e66220d23b6d2027c1/packages/rocketchat-ui/client/lib/readMessages.js#L125-L128

Why don't livechat room have name property? or should we use room id instead of name to open a room?

livechat uux bug

Most helpful comment

I updated issue with picture, what I mean was the unread bar (Mark as read bar) which is shown on the top of room. Thanks

All 8 comments

Can you please test the on latest 0.72.3

Hi @IITNTII.

I'm on our latest version and everything seems to work fine.

screen shot 2018-12-13 at 18 15 13

I updated issue with picture, what I mean was the unread bar (Mark as read bar) which is shown on the top of room. Thanks

On it, will try to fix this.

@renatobecker I am working on it

hi @renatobecker For livechat rooms name property is not defined as @tntho mentioned. Therefore RoomManager.openedRooms[subscription.t + subscription.name] is undefined for livechat rooms. I have fixed this by taking rid in place of name.
Please review #16809

The Livechat rooms can't use the name property because there is a unique index for this field and the Livechat rooms use the guest/visitor name to identify the room, so it would be duplicated. Due to that, the Livechat rooms use the fname property instead of the name property, and the same happens to Subscriptions.

Thanks.

@renatobecker Got it :+1:
So we have to rely on RoomManager.openedRooms[subscription.t + subscription.rid] instead of RoomManager.openedRooms[subscription.t + subscription.name] for solving this issue because the key for RoomManager.openedRooms in case of livechat rooms is subscription.t + subscription.rid

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zeigerpuppy picture zeigerpuppy  路  3Comments

amayer5125 picture amayer5125  路  3Comments

tanc picture tanc  路  3Comments

mddvul22 picture mddvul22  路  3Comments

engelgabriel picture engelgabriel  路  3Comments