refactor: LivechatInquiry out of DB Watcher#32358
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32358 +/- ##
===========================================
- Coverage 56.54% 56.50% -0.04%
===========================================
Files 2484 2480 -4
Lines 54749 54731 -18
Branches 11308 11314 +6
===========================================
- Hits 30958 30928 -30
- Misses 21113 21134 +21
+ Partials 2678 2669 -9
Flags with carried forward coverage won't be shown. Click here to find out more. |
63fbc5a to
cfb85c4
Compare
7a6a36b to
aac311c
Compare
e77133e to
57654d3
Compare
…inquiries-out-of-db-watcher
3c66efe to
5a4a5ee
Compare
…inquiries-out-of-db-watcher
…inquiries-out-of-db-watcher
As per the updates mentioned in PROJ-7, SCA-7 and ADR #74, this pull request focuses on relocating LivechatInquiry entity out of DB Watcher service.
Quick context to public readers
In essence, this modification empowers RocketChat's app to directly call listeners through the
api.broadcastglobal function, eliminating the reliance on MongoDB Change Stream data propagationWhy is this beneficial? It provides better control over notifying users by enabling more precise use-case management. Unlike Change Streams, which notify every action on Mongo's documents and sometimes might result in unnecessary duplicate notifications. Moreover, it contributes to the future removal of the DB Watcher deployment, thereby optimizing resource utilization.
Proposed changes
Key changes include:
dbWatchersDisabledflag.watch.inquirieslistener event, subject to thedbWatchersDisabledflag.Updated use cases.
Steps to test or reproduce
DISABLE_DB_WATCHERSflag set to true.${inquiry._id}department/${inquiry.department}publicAll socket notifications come with the prefix
livechat-inquiry-queue-observer.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.