refactor: Rooms out of DB Watcher#32305
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32305 +/- ##
===========================================
- Coverage 55.57% 54.93% -0.64%
===========================================
Files 2404 2353 -51
Lines 52896 51951 -945
Branches 10862 10627 -235
===========================================
- Hits 29395 28540 -855
+ Misses 20895 20844 -51
+ Partials 2606 2567 -39
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Looks like this PR is ready to merge! 🎉 |
KevLehman
left a comment
There was a problem hiding this comment.
don't forget LivechatRooms :please:
As per the updates mentioned in PROJ-7 SCA-4 and ADR #74, this pull request focuses on relocating Rooms 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.roomslistener event, subject to thedbWatchersDisabledflag.Updated use cases.
POST api/v1/rooms.changeArchivationState
POST api/v1/rooms.changeArchivationState
Steps to test or reproduce
DISABLE_DB_WATCHERSflag set to true.POSTrequest to above given endpoints available on updated use cases.rooms-changed, containing all changed fields as well as the updated room identification data.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, considering time constraints and the absence of tests for this core server component, this direction was chosen as the most pragmatic approach.
Rooms model WBS. Used to guide changes discovery.
🔄 Work in progress
✅ Done
➖ Not applicable