Skip to content

Comments

[NEW][EE] Introduce fallback department support#23939

Merged
KevLehman merged 4 commits intodevelopfrom
improve/fallback-department
Dec 21, 2021
Merged

[NEW][EE] Introduce fallback department support#23939
KevLehman merged 4 commits intodevelopfrom
improve/fallback-department

Conversation

@KevLehman
Copy link
Member

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

@lgtm-com
Copy link

lgtm-com bot commented Dec 14, 2021

This pull request introduces 1 alert when merging 831cb1b into e62d8d4 - view on LGTM.com

new alerts:

  • 1 for Syntax error

@lgtm-com
Copy link

lgtm-com bot commented Dec 14, 2021

This pull request introduces 1 alert when merging d2297a3 into ac24dd5 - view on LGTM.com

new alerts:

  • 1 for Syntax error

@KevLehman KevLehman marked this pull request as ready for review December 16, 2021 17:53
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2021

CLA assistant check
All committers have signed the CLA.

@murtaza98 murtaza98 self-requested a review December 17, 2021 15:15
@casalsgh casalsgh added this to the 4.3.0 milestone Dec 20, 2021
@murtaza98
Copy link
Contributor

Hi @KevLehman I was not able to get this feature to work on Manual Selection algorithm. When I try to start a livechat chat with an offline department with a fallback department configured, it gives me this error Error starting a new conversation: Sorry, no online agents [no-agent-online]. I've checked that the fallback department has at least a single agent online.

Here's my debug log

I20211220-19:03:20.029(5.5)? [2021-12-20T13:33:20.029Z] DEBUG (Callbacks/15920 on murtaza-Lenovo-Legion-5-15IMH05): Executing callback with id livechat-on-check-room-params-api for hook livechat.onCheckRoomApiParams
I20211220-19:03:20.033(5.5)? [2021-12-20T13:33:20.032Z] DEBUG (Livechat/15920 on murtaza-Lenovo-Legion-5-15IMH05): Attempting to find or create a room for visitor JmdpzcCy6ahfP6wgm
I20211220-19:03:20.037(5.5)? [2021-12-20T13:33:20.037Z] DEBUG (Callbacks/15920 on murtaza-Lenovo-Legion-5-15IMH05): Executing callback with id livechat-check-default-agent-new-room for hook livechat.checkDefaultAgentOnNewRoom
I20211220-19:03:20.039(5.5)? [2021-12-20T13:33:20.038Z] DEBUG (Livechat/15920 on murtaza-Lenovo-Legion-5-15IMH05): Calling QueueManager to request a room for visitor JmdpzcCy6ahfP6wgm
I20211220-19:03:20.039(5.5)? [2021-12-20T13:33:20.039Z] DEBUG (QueueManager/15920 on murtaza-Lenovo-Legion-5-15IMH05): Requesting a room for guest JmdpzcCy6ahfP6wgm
I20211220-19:03:20.039(5.5)? [2021-12-20T13:33:20.039Z] DEBUG (Livechat/15920 on murtaza-Lenovo-Legion-5-15IMH05): Checking online agents for department Y5WMZRJo44LJJbjSn
I20211220-19:03:20.041(5.5)? [2021-12-20T13:33:20.041Z] DEBUG (Livechat/15920 on murtaza-Lenovo-Legion-5-15IMH05): Are online agents for department Y5WMZRJo44LJJbjSn?: false
I20211220-19:03:20.041(5.5)? [2021-12-20T13:33:20.041Z] DEBUG (QueueManager/15920 on murtaza-Lenovo-Legion-5-15IMH05): Cannot create room for visitor JmdpzcCy6ahfP6wgm. No online agents
I20211220-19:03:20.043(5.5)? [2021-12-20T13:33:20.042Z] USERLVL (API/15920 on murtaza-Lenovo-Legion-5-15IMH05): Sorry, no online agents [no-agent-online]
I20211220-19:03:20.043(5.5)?     status: 400
I20211220-19:03:20.043(5.5)?     responseTime: 13
I20211220-19:03:20.043(5.5)?     method: "GET"
I20211220-19:03:20.043(5.5)?     url: "/api/v1/livechat/room?token=9ba0edf870445a38ab7b03e4e96c3de4ca808ecbddadea31fd7896e73d24a5e4"
I20211220-19:03:20.043(5.5)?     userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Safari/537.36"
I20211220-19:03:20.043(5.5)?     host: "localhost:3000"
I20211220-19:03:20.043(5.5)?     referer: "http://localhost:3000/livechat"
I20211220-19:03:20.043(5.5)?     remoteIP: "127.0.0.1"
I20211220-19:03:20.043(5.5)?     err: {
I20211220-19:03:20.043(5.5)?       "type": "errorClass",
I20211220-19:03:20.043(5.5)?       "message": "Sorry, no online agents [no-agent-online]",
I20211220-19:03:20.044(5.5)?       "stack":
I20211220-19:03:20.044(5.5)?           Error: Sorry, no online agents [no-agent-online]
I20211220-19:03:20.044(5.5)?               at app/livechat/server/lib/QueueManager.js:45:10
I20211220-19:03:20.044(5.5)?               at /home/murtaza/.meteor/packages/promise/.0.11.2.1smi0dw.wucd++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
I20211220-19:03:20.053(5.5)?            => awaited here:
I20211220-19:03:20.053(5.5)?               at Function.Promise.await (/home/murtaza/.meteor/packages/promise/.0.11.2.1smi0dw.wucd++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)
I20211220-19:03:20.053(5.5)?               at app/livechat/server/lib/Livechat.js:179:8
I20211220-19:03:20.054(5.5)?               at /home/murtaza/.meteor/packages/promise/.0.11.2.1smi0dw.wucd++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
I20211220-19:03:20.054(5.5)?            => awaited here:
I20211220-19:03:20.054(5.5)?               at Function.Promise.await (/home/murtaza/.meteor/packages/promise/.0.11.2.1smi0dw.wucd++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)
I20211220-19:03:20.054(5.5)?               at Object.get (app/livechat/server/api/v1/room.js:55:19)
I20211220-19:03:20.054(5.5)?               at app/api/server/api.js:407:96
I20211220-19:03:20.054(5.5)?               at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
I20211220-19:03:20.054(5.5)?               at Object._internalRouteActionHandler [as action] (app/api/server/api.js:407:39)
I20211220-19:03:20.054(5.5)?               at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)
I20211220-19:03:20.054(5.5)?               at packages/nimble_restivus/lib/route.coffee:59:33
I20211220-19:03:20.054(5.5)?               at packages/simple_json-routes.js:98:9
I20211220-19:03:20.054(5.5)?       "isClientSafe": true,
I20211220-19:03:20.054(5.5)?       "error": "no-agent-online",
I20211220-19:03:20.054(5.5)?       "reason": "Sorry, no online agents",
I20211220-19:03:20.054(5.5)?       "errorType": "Meteor

@KevLehman KevLehman changed the title [NEW] Introduce fallback department support [NEW][EE] Introduce fallback department support Dec 20, 2021
Copy link
Contributor

@murtaza98 murtaza98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@KevLehman KevLehman merged commit 1ac269a into develop Dec 21, 2021
@KevLehman KevLehman deleted the improve/fallback-department branch December 21, 2021 16:51
@sampaiodiego sampaiodiego mentioned this pull request Dec 29, 2021
@felipetomm
Copy link

Hey guys, @murtaza98 or @KevLehman, please, can you shortly explain how work this new feature?
Thank you!

@murtaza98
Copy link
Contributor

murtaza98 commented Dec 30, 2021

Hey @felipetomm Here's some context about this feature

In case an end-customers reaches out to a department but there are no available agents to help, customers get frustrated. which is bad in terms of reputation and customer satisfaction, so in order to reduce this bad user experience, we're going to add a new tool/feature for companies to reduce resolution time as chats will be automatically forwarded to a fallback department is the initial department is offline.

The ability to set up a fallback department will be available on:

  • Department Form, as a "select" field. (UI)
  • Rest API endpoints (Create or Edit departments)

PS: This feature will be documented very soon within our docs

@felipetomm
Copy link

Thank you @murtaza98 !
Just one more question, when we use the "Accept with No Online Agents" param enabled, what the behavior when a new conversation comes up to one department with no agents online and the same have an fallback department?
I think that feature can be more priority rather than agents offline. With this, we can use them both right?

@murtaza98
Copy link
Contributor

@felipetomm In the above case, considering we have the "Accept with No Online Agents" param enabled and the target department doesn't have any agent online + has a fallback department set - then the chat will get assigned to the fallback department.

Even here there are 2 scenarios based on the agent's availability in the fallback department.

  • At least one agent is online in the fallback department: Chat will be assigned to that agent
  • No agent is online in the fallback department: The chat will stay in the queue until some agent from the fallback department comes online

@felipetomm
Copy link

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants