-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[NEW][ENTERPRISE] Maximum waiting time for chats in Omnichannel queue #22955
Conversation
…ketChat/Rocket.Chat into improve/close-abandoned-queued-chats
ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.js
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
const timer = settings.get('Livechat_max_queue_wait_time'); | ||
callbacks.add('livechat:afterReturnRoomAsInquiry', setQueueTimer(timer), callbacks.priority.HIGH, 'livechat-after-return-room-as-inquiry-set-queue-timer'); |
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.
We can't rely only on this callback to update the estimated Inactivity close time
because this callback is only called when the routing system algorithm is Manual Selection
, but Inquiries are queued in all algorithms, so we need to rely on a more consist solution that will cover all use cases.
So, we need to track this method -> LivechatInquiry.queueInquiry
. As far as I know, the method is called twice in the code, so rather than calling LivechatInquiry.queueInquiry
directly, we could maybe create a new method that would be called and inside the new method you'd call -> LivechatInquiry.queueInquiry
and, also, run a new callback method right away, so rather than implementing this logic here, you could implement the logic for the new callback I just mentioned, something like: livechat:afterQueueInquiry
, WDYT?
You could, even, improve the signature of the method Livechat.queueInquiry
and support additional data, so you could also pass along the new value of estimatedInactivityCloseTimeAt
and update the document at once.
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.
Hey but this callback is called only on returnRoomAsInquiry
method, this callback should just set the value again when the user returns the chat to the queue, and as far as i can see on app/livechat/server/lib/Livechat.js L663
this should happen disregards of the routing algorithm.
The callback that sets the value when the chat first comes is on the createLivechatInquiry
method (using the livechat.beforeInquiry
cb) and that should also run on all routing algos, since it happens before queueing the inquiry.
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.
Regarding returnRoomAsInquiry
:
- The method is called when a user returns the chat to the queue manually(Only available on Manual Selection)
- The method is called when the agent didn't reply and the chat is auto-transferred, however, there's a condition:
RoutingManager.getConfig().autoAssignAgent
====Manual Selection
.
Apart from that, the chat can be queued in other places, such as here:
Rocket.Chat/app/livechat/server/lib/Helper.js
Lines 409 to 412 in 6267bf4
if (chatQueued) { | |
LivechatInquiry.readyInquiry(inquiry._id); | |
const newInquiry = LivechatInquiry.findOneById(inquiry._id); | |
await queueInquiry(room, newInquiry); |
So, as you can see, the chat will be queued, but the estimatedInactivityCloseTimeAt
won't be set, that's the reason we should implement a more centralized solution that would cover all cases and would reduce complexity.
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.
That's interesting to know. What about using the livechat.beforeRouteChat
to set that value then? (or create another callback def at the same place as this) to avoid having to modify multiple files by changing the function signature?
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.
IMHO we should wrap the method LivechatInquiry.queueInquiry
(called twice in the codebase) in a new method that, as the last step, would call a new callback, perhaps -> livechat:afterQueueInquired
and, then, implement the logic for the new callback.
In this case, we wouldn't need to implement callbacks for livechat.beforeInquiry
nor livechat:afterReturnRoomAsInquiry
, just one single callback method would do the trick.
ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.ts
Outdated
Show resolved
Hide resolved
ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.ts
Outdated
Show resolved
Hide resolved
…ketChat/Rocket.Chat into improve/close-abandoned-queued-chats
…ketChat/Rocket.Chat into improve/close-abandoned-queued-chats
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments