-
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
fix: New livechat conversations are not assigned to contact manager #34210
base: develop
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d89c89e The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks like this PR is ready to merge! 🎉 |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #34210 +/- ##
===========================================
- Coverage 75.81% 75.27% -0.54%
===========================================
Files 512 516 +4
Lines 22221 22540 +319
Branches 5407 5485 +78
===========================================
+ Hits 16846 16968 +122
- Misses 4722 4911 +189
- Partials 653 661 +8
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Tests? :please:
apps/meteor/ee/app/livechat-enterprise/server/hooks/handleNextAgentPreferredEvents.ts
Outdated
Show resolved
Hide resolved
apps/meteor/ee/app/livechat-enterprise/server/hooks/handleNextAgentPreferredEvents.ts
Outdated
Show resolved
Hide resolved
(IS_EE ? it : it.skip)('should route to contact manager if it is online', async () => { | ||
const room = await createLivechatRoom(visitor.token); | ||
|
||
await sleep(5000); |
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.
Is this really necessary?
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're doing this in all other routing tests in this describe 🤔 shouldn't we keep doing this, then?
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.
If it's not extremely necessary we shouldn't, but if we are already doing for the other cases 🤷♂️
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.
yeah, I'm just afraid of removing this and creating a flaky test 😢
but we could try removing all sleeps from these tests at some point. I believe we're running all callbacks sync 👀
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.
Also, can we create a test case to cover the scenario found by the QA team where:
While visitor attempts to send a second message, it gets redirected to the agent, but on first attempt, it throws error.
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.
This was happening on CE and is already being caught by our tests. CI failed due to this same condition by the time our QA team reported this, so we should be fine :)
Proposed changes (including videos or screenshots)
contactManager
property stored in contacts when deciding the default new agent to assign to a livechat room (instead of only considering thecontactManager
field in visitors, which is not maintained anymore).Issue(s)
Steps to test or reproduce
In a Premium workspace, enable the "Assign new conversations to the contact manager" setting under Settings > Omnichannel > Routing. Then create a new contact manually (in the livechat contact center) using a livechat agent and assign yourself user as the contact manager (use the
contacts.get
endpoint to make sure thecontactManager
field contains the user id of the agent who created the contact). Then start a new livechat conversation using the info from the contact that has just been created.Expected result: the contact manager should be automatically assigned to the room if it is online.
Note: use "Auto Selection" as the "Omnichannel Routing Method" (under Settings > Omnichannel > Routing). Otherwise, only bot contact managers will be auto assigned to rooms.
Further comments
CORE-862