fix: Remove room assignment before queueing the conversation again when transfering (#36577)

pull/36575/head^2
Kevin Aleman 5 months ago committed by GitHub
parent 09b424b25d
commit eed22e5dec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .changeset/eleven-buses-return.md
  2. 12
      apps/meteor/app/livechat/server/lib/RoutingManager.ts

@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---
Fixes an issue where rooms transferred to a department's queue could get stuck—marked as taken but with no agent assigned.

@ -180,6 +180,12 @@ export const RoutingManager: Routing = {
const { servedBy } = room;
if (servedBy) {
await LivechatRooms.removeAgentByRoomId(rid);
await this.removeAllRoomSubscriptions(room);
await dispatchAgentDelegated(rid);
}
if (shouldQueue) {
const queuedInquiry = await LivechatInquiry.queueInquiry(inquiry._id, room.lastMessage);
if (queuedInquiry) {
@ -192,12 +198,6 @@ export const RoutingManager: Routing = {
}
}
if (servedBy) {
await LivechatRooms.removeAgentByRoomId(rid);
await this.removeAllRoomSubscriptions(room);
await dispatchAgentDelegated(rid);
}
await dispatchInquiryQueued(inquiry);
return true;

Loading…
Cancel
Save