RocketChat / Rocket.Chat

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

New Chat Alert Sounds for members of different departments #18753

Closed dennishenry closed 4 years ago

dennishenry commented 4 years ago

Description:

We just recently added more departments to our RocketChat Omnichannel and we are getting reports that users are getting audible alerts for chats in other departments of which they are not agents. They are not getting visible alerts from the agent, but only the sound alert.

Steps to reproduce:

  1. Set up multiple Omnichannel departments with users in different departments
  2. Open a chat for a user in X department
  3. User from Y department will get audible new chat ping

Expected behavior:

Users to only recieve chat pings for chats in their department

Actual behavior:

Pings for all chats for all agents

Server Setup Information:

Client Setup Information

seanhostdime commented 4 years ago

After a bit of work on this, I found that we were opening new chats without departments via the REST API. We never included a department id in the POST when hitting /api/v1/livechat/visitor. Because the new chat had no department, RocketChat was notifying all users. By the time our agents checked the notification, the new chat was forwarded into a department leading to the confusion. In the RC source, I found the department param to avoid this, but it's missing from your documentation.

Here is the param in question : https://github.com/RocketChat/Rocket.Chat/blob/develop/app/livechat/server/api/v1/visitor.js#L18

And here is the documentation page that needs to be updated: https://docs.rocket.chat/api/rest-api/methods/livechat/visitor

renatobecker commented 4 years ago

Hi @dennishenry Thanks for reporting this case but I have to say I just can't reproduce the issue. You might be using the Manual Selection routing system, right? If so, here you can see how we get the list of online agents to send the sound notification:

https://github.com/RocketChat/Rocket.Chat/blob/develop/app/livechat/server/lib/routing/ManualSelection.js#L49

As you can see, the method considers the department parameter, so only agents associated with that department will be returned. So, if you have any other information to share which can be used to reproduce the issue, it'd be very appreciated.

Thanks.

dennishenry commented 4 years ago

@renatobecker The problem was that we were creating the chat without a department, then assigning it in a later call. Once we realized that we were able to register the visitor with a department as @seanhostdime mentioned, the issue went away. Since this appears to be proper functionality, I'd suggest just adding the information @seanhostdime mentioned to the documentation so others know that they can create a visitor with a department defined, rather then creating it with no department (thus pinging all users in all departments), then assigning a department with a later call

renatobecker commented 4 years ago

@renatobecker The problem was that we were creating the chat without a department, then assigning it in a later call. Once we realized that we were able to register the visitor with a department as @seanhostdime mentioned, the issue went away. Since this appears to be proper functionality, I'd suggest just adding the information @seanhostdime mentioned to the documentation so others know that they can create a visitor with a department defined, rather then creating it with no department (thus pinging all users in all departments), then assigning a department with a later call

Cool! We gonna update the doc page, for sure! Thanks for sharing all this information.

So, I think we can close this issue, right?

dennishenry commented 4 years ago

Sure - closing now