New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Permissions out of DB Watcher #32360
Conversation
|
Looks like this PR is ready to merge! 🎉 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32360 +/- ##
===========================================
- Coverage 55.62% 55.60% -0.02%
===========================================
Files 2408 2408
Lines 52965 52997 +32
Branches 10884 10894 +10
===========================================
+ Hits 29462 29470 +8
- Misses 20888 20918 +30
+ Partials 2615 2609 -6
Flags with carried forward coverage won't be shown. Click here to find out more. |
617a2dc
to
f814553
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it needs to get conflicts solved as well
e8e2e18
to
6c38385
Compare
Additionally, I've used this PR to relocate Role related functions to the same |
2881d6f
to
7adfa6c
Compare
7adfa6c
to
94da5a2
Compare
As per the updates mentioned in PROJ-7 SCA-4 and ADR #74, this pull request focuses on relocating Permissions 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.permission.changed
listener event, subject to thedbWatchersDisabled
flag.Updated use cases.
authorization:removeRoleFromPermission
permissions.update
authorization:addPermissionToRole
Steps to test or reproduce
DISABLE_DB_WATCHERS
flag set to true.POST
request to above given endpoints available on updated use cases.eventName: permissions-changed
, containing all changed fields as well as the updated permission 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.
Startup and feature activation events were not refactored to call listener event.
Permissions model WBS. Used to guide changes discovery.
🔄 Work in progress
✅ Done
➖ Not applicable