Add installation events
d-gubert opened this issue · 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)