Skip to content

Conversation

@ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Feb 14, 2025

Proposed changes (including videos or screenshots)

This PR fixes the Livechat routing algorithm to correctly assign conversations to the contact manager when triggers and/or automatic agent routing are enabled.

  • Checking contact manager on callback livechat.checkDefaultAgentOnNewRoom: we now verify if the user has a different contact manager than the one initially assigned via agent.next or livechat.config routes.

  • Handling contact manager on guest registration: in the registerGuest method (server lib), we now check if the provided email is already associated with a contact manager. If a contact manager is found, the response from the visitor creation endpoint will include the correct manager data. This ensures that the Livechat widget UI correctly reflects agent changes during visitor creation.

Issue(s)

Steps to test or reproduce

Further comments

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 14, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2025

🦋 Changeset detected

Latest commit: c2c8f6b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/livechat Patch
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

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

@ricardogarim ricardogarim changed the title Fix/livechat routing contact manager fix: livechat routing contact manager Feb 14, 2025
@ricardogarim ricardogarim changed the title fix: livechat routing contact manager fix: adds contact manager check before assigning to agent Feb 14, 2025
@codecov
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.64%. Comparing base (335f19f) to head (c2c8f6b).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35205      +/-   ##
===========================================
- Coverage    59.67%   59.64%   -0.04%     
===========================================
  Files         2829     2828       -1     
  Lines        68786    68537     -249     
  Branches     15236    15191      -45     
===========================================
- Hits         41051    40879     -172     
+ Misses       25076    25010      -66     
+ Partials      2659     2648      -11     
Flag Coverage Δ
unit 75.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardogarim ricardogarim added this to the 7.4.0 milestone Feb 14, 2025
@ricardogarim ricardogarim marked this pull request as ready for review February 17, 2025 10:20
@ricardogarim ricardogarim requested review from a team as code owners February 17, 2025 10:20
Copy link
Contributor

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Can we add some tests to ensure this behavior?

Co-authored-by: Marcos Spessatto Defendi <marcos.defendi@rocket.chat>
Copy link
Contributor

@aleksandernsilva aleksandernsilva left a comment

Choose a reason for hiding this comment

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

LGTM

PS.: If you could create a separate PR with tests covering this scenario would be much appreciated.

@scuciatto scuciatto modified the milestones: 7.4.0, 7.5.0 Feb 21, 2025
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Feb 26, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Feb 26, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Feb 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35205/

Built to branch gh-pages at 2025-03-08 12:56 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@scuciatto scuciatto added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Mar 9, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 9, 2025
@kodiakhq kodiakhq bot merged commit f925052 into develop Mar 9, 2025
51 checks passed
@kodiakhq kodiakhq bot deleted the fix/livechat-routing-contact-manager branch March 9, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants