-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: Omnichannel's max amount of simultaneous chats not correctly evaluated #35722
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
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 3f11f01 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 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 |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35722 +/- ##
===========================================
- Coverage 60.96% 60.95% -0.02%
===========================================
Files 2952 2956 +4
Lines 70308 70574 +266
Branches 16137 16215 +78
===========================================
+ Hits 42866 43019 +153
- Misses 24495 24606 +111
- Partials 2947 2949 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Can you add a description and the steps to reproduce? |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts
Show resolved
Hide resolved
apps/meteor/ee/app/livechat-enterprise/server/hooks/checkAgentBeforeTakeInquiry.ts
Show resolved
Hide resolved
c84c89c
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
This pull request addresses a critical issue in the Rocket.Chat Omnichannel feature, specifically the evaluation of maximum simultaneous chat limits for agents. The changes focus on refining the logic to ensure accurate enforcement of chat limits at various levels, including agent, global, and department-specific limits.
Key changes include:
Introduction of a New Helper Function: A new function,
isAgentWithinChatLimits, has been introduced to replace the previousgetMaxNumberSimultaneousChatfunction. This function evaluates whether an agent can accept more chats based on the configured limits, considering agent, department, and global constraints. This refactor aims to improve the robustness and clarity of the limit evaluation process.Refactoring of MongoDB Queries: The logic for constructing MongoDB query filters has been simplified. The previous nested
$or/$andstructure has been replaced with a more linear approach, enhancing readability and maintainability. Additionally, the aggregation pipeline in thegetUnavailableAgentsmethod has been optimized for better performance and robustness.Enhancements to Method Signatures: The
getAgentAndAmountOngoingChatsmethod in theIUsersModelinterface has been updated to include an optionaldepartmentIdparameter. This change allows for the retrieval of department-specific chat counts, providing more granular control over chat limit evaluations.Refactoring of Livechat Hooks: The logic within the
beforeJoinRoomandcheckAgentBeforeTakeInquiryhooks has been refactored to utilize the new helper function. This change streamlines the process of checking chat limits before agents join rooms or take inquiries, ensuring consistent application of the new logic.Changeset Addition: A changeset file has been added to document the fix and the new logic for applying maximum simultaneous chat limits, ensuring that these changes are tracked and communicated effectively.
Overall, this pull request enhances the accuracy and efficiency of chat limit evaluations in the Rocket.Chat Omnichannel feature, providing a more reliable experience for agents and administrators.
CTZ-50
[CTZ-31]