refactor: Integration entity out of db watcher #32378
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per the updates mentioned in PROJ-7 SCA-4 and ADR #74, this pull request focuses on relocating Integration 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.broadcast
global 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:
dbWatchersDisabled
flag.watch.integrations
listener event, subject to thedbWatchersDisabled
flag.Updated use cases.
users.delete
saveRoomName
on channel-settings packagedeleteIncomingIntegration
integrations.remove
updateIncomingIntegration
integrations.update
integrations.create
executeTriggerUrl
onRocketChatIntegrationHandler
fileSteps to test or reproduce
DISABLE_DB_WATCHERS
flag set to true.POST
request to above given endpoints available on updated use cases.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.
Integration model WBS. Used to guide changes discovery.
🔄 Work in progress
✅ Done
➖ Not applicable