refactor: IntegrationHistory out of DB Watcher#32502
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 |
|
…tion when starting db watcher
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32502 +/- ##
===========================================
- Coverage 56.38% 56.33% -0.05%
===========================================
Files 2434 2434
Lines 53693 53708 +15
Branches 11050 11057 +7
===========================================
- Hits 30275 30259 -16
- Misses 20779 20803 +24
- Partials 2639 2646 +7
Flags with carried forward coverage won't be shown. Click here to find out more. |
…on-history-out-of-db-watcher
…retention * 'develop' of github.com:RocketChat/Rocket.Chat: (36 commits) refactor: IntegrationHistory out of DB Watcher (#32502) fix: Message update being broadcasted without updated values (#32472) test: make api teams test fully independent (#31756) test: Fix test name (#32490) fix: streams being called with no logged user (#32489) feat: Un-encrypted messages not allowed in E2EE rooms (#32040) feat(UiKit): Users select (#31455) fix: Re-login same browser tab issues (#32479) chore: move all webclient code out of the COSS folders (#32273) chore(deps): bump thehanimo/pr-title-checker from 1.3.7 to 1.4.1 (#30619) fix: Don't show join default channels option for edit user form (#31750) fix: CAS user merge not working (#32444) fix: Overriding Retention Policy not working (#32454) fix: `rooms.export` endpoint generates an empty export when given an invalid date (#32364) fix: "Allow Password Change for OAuth Users" setting is not honored in the "Forgot Password" flow (#32398) fix: Bypass trash when removing OTR system messages and read receipts (#32269) fix: Monitors dissapearing from Unit upon edit (#32393) fix: Link image preview not opening in gallery (#32391) feat: Allow visitors & integrations to access downloaded files after a room has closed (#32439) regression: Users tab misaligned (#32451) ...
Co-authored-by: Diego Sampaio <8591547+sampaiodiego@users.noreply.github.com>
As per the updates mentioned in PROJ-7, SCA-10 and ADR #74, this pull request focuses on relocating
IntegrationHistorymodel 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.integrationHistorylistener event, subject to thedbWatchersDisabledflag.clearIntegrationHistorySteps to test or reproduce
DISABLE_DB_WATCHERSenvironment variable set totrue.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
IntegrationHistory.createandIntegrationHistory.updateById.