-
Notifications
You must be signed in to change notification settings - Fork 13.1k
[FIX] Livechat Agents & monitors not able to pick up chats from queue #24541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| const inquiry = Template.instance().inquiry.get(); | ||
| const room = Template.instance().room.get(); | ||
| return (inquiry && inquiry.status === 'queued') || !room.servedBy; | ||
| return inquiry && inquiry.status === 'queued'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gotta say: this works. this won't solve other room-related issues when some room props are updated (like room's name/visibility) but will solve our use case so we should be fine for now.
I'll create a task to address the bigger one.
| }); | ||
| if (!userCanTakeInquiry(user)) { | ||
| throw new Meteor.Error('error-not-allowed', 'Not allowed', { | ||
| throw new Meteor.Error('error-not-allowed-due-to-offline', `Not allowed since user's status is offline`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it true that the only reason for not being able to take the inquiry is because the user is offline? 👀
| 'cant-join-room', | ||
| ); | ||
|
|
||
| callbacks.add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do this callback needs to be inside a Meteor.startup? Can be on its own ts file and imported on this one? 👀
Additionally, can you add this callback signature to the callback types? (on lib/callbacks.ts)
| callbacks.add( | ||
| 'beforeJoinRoom', | ||
| function (user, room) { | ||
| if (room.t === 'l' && !room.servedBy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You can use the
isOmnichannelRoomfunction to check if the room is an omnichannel room. - Change the sense of the if so that if the room is not livechat or the room is already assigned you return the user, so the code can be unnested
Proposed changes (including videos or screenshots)
Issue(s)
Monitor|Agent can't take the actual chat by pressing the "Take It" button.
Steps to test or reproduce
Expected Behavior:
Be able to send messages after clicking on the "Take it" button
Actual Behavior:
A warning says "Not permitted" after clicking the button
Further comments
Sidenote from an implementation perspective: In this new PR, we've modified the logic in a way that reverses the changes done here (where this issue was actually introduced) but still fixes the issue in that PR (i.e. Closed chats doesn't show who picked the call) by listening to the "beforeJoinRoom" hook & automatically assign the manager/monitor to the chat, in case no agent is assigned to the chat at that point