Skip to content
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

New "essentials" mechanism #269

Merged
merged 4 commits into from
May 17, 2020
Merged

Conversation

d-gubert
Copy link
Member

@d-gubert d-gubert commented May 12, 2020

What? ⛵

This is a mechanism that allows an app to register itself as "essential" to an event in the Rocket.Chat lifecycle.

If an app that is "essential" is disabled during the execution of such event, an error is thrown.

Why? 🤔

Currently, we have a problem regarding the state management of apps in HA setups. Each instance in the cluster has to manage the apps that are enabled/disabled, and should communicate any changes to the other instances when they happen, but this has shown to be unreliable in times when there is high usage.

This mechanism presents a way of "shielding" workspaces that require custom rules for critical events (message sending, room creating, etc.) to take place from this unpredictable problems.

Links 🌎

RocketChat/Rocket.Chat#17656

PS 👀

@d-gubert d-gubert requested a review from rodrigok May 12, 2020 20:54
@codecov
Copy link

codecov bot commented May 12, 2020

Codecov Report

Merging #269 into new-room-events will decrease coverage by 0.91%.
The diff coverage is 17.39%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           new-room-events     #269      +/-   ##
===================================================
- Coverage            54.57%   53.66%   -0.92%     
===================================================
  Files                   82       82              
  Lines                 2904     2909       +5     
  Branches               415      421       +6     
===================================================
- Hits                  1585     1561      -24     
- Misses                1319     1348      +29     
Impacted Files Coverage Δ
src/server/AppManager.ts 14.39% <0.00%> (-0.18%) ⬇️
src/server/ProxiedApp.ts 14.11% <0.00%> (-0.35%) ⬇️
src/server/managers/AppListenerManager.ts 7.67% <30.30%> (+0.29%) ⬆️
src/server/compiler/AppImplements.ts 100.00% <100.00%> (ø)
src/server/compiler/index.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcdd3b0...e05db9c. Read the comment docs.

src/server/managers/AppListenerManager.ts Outdated Show resolved Hide resolved
src/server/managers/AppListenerManager.ts Outdated Show resolved Hide resolved
src/server/AppManager.ts Show resolved Hide resolved
@d-gubert d-gubert marked this pull request as ready for review May 15, 2020 21:33
@d-gubert d-gubert merged commit e654965 into new-room-events May 17, 2020
@rodrigok rodrigok deleted the essential-event-registration branch May 18, 2020 12:05
d-gubert added a commit that referenced this pull request May 19, 2020
* Fix security problem

* Add IPreRoomUserJoined event

* Add the IPostRoomUserJoined event

* New "essentials" mechanism (#269)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants