refactor: LivechatDepartmentAgents out of DB Watcher#32504
refactor: LivechatDepartmentAgents out of DB Watcher#32504kodiakhq[bot] merged 14 commits intodevelopfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32504 +/- ##
===========================================
- Coverage 56.36% 56.36% -0.01%
===========================================
Files 2435 2432 -3
Lines 53710 53704 -6
Branches 11062 11059 -3
===========================================
- Hits 30273 30268 -5
- Misses 20791 20796 +5
+ Partials 2646 2640 -6
Flags with carried forward coverage won't be shown. Click here to find out more. |
… with dept agents
…dept-agent-out-of-db-watcher
4a4664e to
8408c78
Compare
As per the updates mentioned in PROJ-7, SCA-8 and ADR #74, this pull request focuses on relocating
LivechatDepartmentAgentsmodel out of DB Watcher service.Context
This modification enhances RocketChat's app by allowing it to directly call listeners through the
api.broadcastglobal function, bypassing the need for MongoDB Change Stream data propagation.This change offers better control over user notifications via Web Sockets, enabling more precise management of use-cases. Instead of notifying every database change, we can now send an
api.broadcastcall only when necessary, reducing overall network messages. Additionally, this contributes to the future removal of the DB Watcher deployment, optimizing resource utilization.Proposed changes
Key changes include:
dbWatchersDisabledflag.watch.livechatDepartmentAgentslistener event, subject to thedbWatchersDisabledflag.deleteUserdeleteUserOwnAccountlivechat.afterAgentRemovedtriggered byDELETE
/api/v1/livechat/users/:type/:_idPOST Meteor method
livechat:removeAgent/api/v1/livechat/department/:_id/archivePOST
/api/v1/livechat/department/:_id/unarchivelivechat:removeDepartmentDELETE
/api/v1/livechat/department/:_idSteps to test or reproduce
Further comments
To maintain consistency and avoid potential regressions, event names and signatures have been kept unchanged on both the client and app sides. This decision streamlines efforts and mitigates the risk of unintended consequences.
Additionally, some new model functions have been created to accommodate specific needs when dealing with database operations, such as
LivechatDepartmentAgents.findAgentsByAgentsAndDepartmentId.