Revert "fix: Don't streaming inquiries to client when routing algorithm is not manual selection" (#32183)

pull/32173/head^2
Guilherme Gazzo 2 years ago committed by GitHub
parent 9457442c0a
commit 4f5deef0aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      .changeset/clever-guests-invent.md
  2. 6
      apps/meteor/server/modules/listeners/listeners.module.ts

@ -1,8 +0,0 @@
---
"@rocket.chat/meteor": patch
---
Avoid streaming inquiries to client when routing algorithm is not manual selection. Previously, all inquiries where sent to the client no matter which routing was used. Inquiries are not shown on the UI or interacted with when the inquiry is not manual selection.
Moreover, when the algorithm changes from Auto to Manual, the UI gets the updated list of inquiries from the server, cleaning the ones received up to that point.
Change will reduce the data sent over the wire and stored on the client's db.

@ -209,12 +209,6 @@ export class ListenersModule {
});
service.onEvent('watch.inquiries', async ({ clientAction, inquiry, diff }): Promise<void> => {
// We do not need inquiries on the client when the routing method is not manual
// When the routing method changes, client fetches inquiries again and discards the received ones
if (settings.get('Livechat_Routing_Method') !== 'Manual_Selection') {
return;
}
const type = minimongoChangeMap[clientAction] as 'added' | 'changed' | 'removed';
if (clientAction === 'removed') {
notifications.streamLivechatQueueData.emitWithoutBroadcast(inquiry._id, {

Loading…
Cancel
Save