-
Notifications
You must be signed in to change notification settings - Fork 13k
regression: Department & Unit limits not correctly applied to agents #36801
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! 🎉 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-7.10.0 #36801 +/- ##
=================================================
Coverage ? 66.01%
=================================================
Files ? 3287
Lines ? 110191
Branches ? 20853
=================================================
Hits ? 72744
Misses ? 34771
Partials ? 2676
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR fixes a regression where department and unit limits were not correctly applied to agents in livechat functionality. The issue was caused by filtering logic that only checked for units but didn't properly handle agents who have departments but no units.
- Updated query filtering logic to check both unit ancestors and direct unit IDs, and include rooms without departments
- Modified test expectations to reflect that monitors with no units can now see public rooms rather than empty results
- Added comprehensive test coverage for the new behavior with agents and monitors
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/meteor/ee/app/livechat-enterprise/server/lib/restrictQuery.ts | Core fix to query filtering logic to handle both units and departments properly |
| apps/meteor/ee/tests/unit/apps/livechat-enterprise/lib/restrictQuery.tests.ts | New comprehensive unit test suite for the restrictQuery function |
| apps/meteor/tests/end-to-end/api/livechat/21-reports.ts | Updated test expectations for monitors with no units to check for public rooms |
| apps/meteor/tests/end-to-end/api/livechat/00-rooms.ts | Added extensive integration tests for unit/room restrictions for agents and monitors |
| apps/meteor/tests/e2e/omnichannel/omnichannel-monitor-role.spec.ts | Updated E2E test expectations and added configuration settings |
| apps/meteor/tests/data/livechat/department.ts | Exported OnlineAgent type for use in other test files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Proposed changes (including videos or screenshots)
Issue(s)
https://rocketchat.atlassian.net/browse/CTZ-312
Steps to test or reproduce
Caused by #36747
Further comments
Basically, we were filtering by the units only, which worked for monitors as they have units. However, this check wasn't working for agents as agents don't have units, only departments.
Now, the check properly filters units & departments, allowing monitors to see a bit more of info they have the rights to see, but that wasn't working because of this limit.