Omnichannel Routing to bot in different department

Open
#26,654 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
mongodb, node.js, typescript
Domain
api, backend, web-dev

Research direction

Reproduce the case with Auto Selection, the widget department set through this.setDepartment("AAA"), and BotA and BotB in separate departments. Start by tracing the Livechat Widget API department value into Omnichannel routing and bot assignment. Done means every conversation from the AAA widget is assigned to BotA and never to BotB; add or run a regression test if the relevant test entry point is found.

Written by the indexing model from the issue text.

Description

Description:

With LiveChat routing method set as Auto Selection and option "Assign new conversations to bot agent" enabled, livechat routes me to bots of different departments in different conversations, even though the livechat widget's department is set.

Steps to reproduce:
  1. Set Omnichannel Routing Method as "Auto Selection" (Settings -> Omnichannel -> Routing)
  2. Set "Assign new conversations to bot" as enabled (Settings -> Omnichannel -> Routing)
  3. Create two departments: AAA and BBB
  4. Create two bot users with 'livechat agent' role: BotA and BotB
  5. Add BotA to department AAA and BotB to department BBB
  6. Create a testing html page and include the Livechat Widget in it.
  7. Set the widget department to department AAA using the Livechat Widget API. Call this.setDepartment("AAA") in the testing page script that configure the widget.
  8. Run the page.
Expected behavior:

BotA to be assigned to every conversation started from this page's widget.
BotB should never be assigned to conversations started from this page's widget.

Actual behavior:

Sometimes BotA is assigned and other times BotB is assigned, even being from another department.

Server Setup Information:
  • Version of Rocket.Chat Server: 4.8.2
  • Operating System: Debian Bullseye
  • Deployment Method: Kubernetes
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v14.18.3
  • MongoDB Version: 4.4.10
Client Setup Information
  • Desktop App or Browser Version: Chrome
  • Operating System: Ubuntu 20.04
Additional context
Relevant logs:
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RocketChat/Rocket.Chat

All issues in RocketChat/Rocket.Chat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.