Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

Add installation events

Open d-gubert opened this issue 5 years ago • 0 comments

Currently, it isn't possible for an app to properly hook some routine to its installation/uninstallation in a Rocket.Chat workspace.

The only lifecycle event that is somewhat related to the installation behavior would be onEnable, but this is potentially run multiple times during the lifecycle of an app (e.g., every time the server restarts) and is also run once for every instance in a cluster (when Rocket.Chat is run in High Availability mode). The onDisable event happens in a similar manner.

The ideal solution would be adding two methods to the App abstract class: onInstall and onUninstall, which are run only once per cluster (i.e, only in one instance if Rocket.Chat is in High Availability mode)

d-gubert avatar Dec 09 '19 14:12 d-gubert