Skip to content

fix: Livechat_accept_chats_with_no_agents omnichannel setting not being respected#39692

Closed
nazabucciarelli wants to merge 68 commits intodevelopfrom
fix/livechat-offline-agent-assignment-setting-fix
Closed

fix: Livechat_accept_chats_with_no_agents omnichannel setting not being respected#39692
nazabucciarelli wants to merge 68 commits intodevelopfrom
fix/livechat-offline-agent-assignment-setting-fix

Conversation

@nazabucciarelli
Copy link
Copy Markdown
Contributor

@nazabucciarelli nazabucciarelli commented Mar 17, 2026

Important Note for reviewers

This PR depends on / is built on top of PR #39495. Because of this, you will see extra files (the changeset file, for instance) and commits included in the diff. Please focus your review exclusively on the logic and tests related to the Livechat_accept_chats_with_no_agents setting. (Once the base PR is merged, the diff will automatically update to show only these specific changes).

Proposed changes (including videos or screenshots)

  • Added a third parameter named acceptChatsWithNoAgents to methods that fetch available agents. It basically passes the value of the Livechat_enabled_when_agent_offline setting downstream, to be able to process it and resolve offline agents to the visitor in case its value is true. This was made since after fixing the query, I've found out that Livechat_enabled_when_agent_offline wasn't being respected, and previously it "worked" (and note the quotation marks) because our query wasn't filtering out offline users at all.
  • Added tests to validate this setting works properly following our modern practices. Created a new task for the modernization of the suite (CORE-1985).

Issue(s)

CORE-1972 Fix 'Livechat_accept_chats_with_no_agents' omnichannel setting not being respected

Steps to test or reproduce

Before testing, you'd need to have a EE license and to create at least two agents and a department with them. Also, you'll need to go to Settings -> Omnichannel -> Queue Management, enable the Waiting queue option and then set Max. number of simultaneous chats to only 1.

  • Test that when two agents belong to the same department, each with a conversation limit of 1, and one agent is already handling a visitor while the other one is offline, and the setting Livechat_accept_chats_with_no_agents is enabled, the new visitor isn't queued, but routed to the offline agent.
  • You could test the opposite case too, disabling the Livechat_accept_chats_with_no_agents setting.

Further comments

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 17, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 60892789-fd2b-47af-befd-7fac677afe83

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 17, 2026

🦋 Changeset detected

Latest commit: 0205f92

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

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/models Minor
@rocket.chat/meteor Minor
@rocket.chat/model-typings Patch
@rocket.chat/omni-core Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/server-fetch Patch
@rocket.chat/ui-client Major
@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/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/media-calls Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/apps Patch
@rocket.chat/network-broker Patch
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-contexts Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Major

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.21%. Comparing base (278b84f) to head (0205f92).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39692      +/-   ##
===========================================
- Coverage    70.24%   70.21%   -0.03%     
===========================================
  Files         3281     3281              
  Lines       116915   116915              
  Branches     20754    20703      -51     
===========================================
- Hits         82122    82088      -34     
- Misses       31512    31542      +30     
- Partials      3281     3285       +4     
Flag Coverage Δ
e2e 59.70% <ø> (-0.02%) ⬇️
e2e-api 47.31% <ø> (+0.86%) ⬆️
unit 71.03% <100.00%> (-0.08%) ⬇️

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.

nazabucciarelli and others added 27 commits April 7, 2026 16:02
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…cketChat/Rocket.Chat into fix/livechat-offline-agent-assignment
@nazabucciarelli nazabucciarelli force-pushed the fix/livechat-offline-agent-assignment-setting-fix branch from db892b5 to 0205f92 Compare April 15, 2026 20:47
@nazabucciarelli
Copy link
Copy Markdown
Contributor Author

To make it easier for review, I've created another PR but against the branch it depends to: #40175

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.

2 participants