We are developing an add-on (app) to Jira Server using RefApp template. It establishes a persistent web-socket connection after installation and reconnects by JobRunner job scheduled to send heartbeat every minute.
There are two major issues:
- the websocket connection is established reliably only after add-on installation. Disable/Enable should trigger the same logic (PluginLifeCycleEventHandler.onInstalled), but sometimes does not and it’s very inconvenient
- after add-on is uninstalled and removed from Jira Server instance, the above mentioned JobRunner may still trigger although there is a scheduler.unscheduleJob(this.job); in JobRunner.destroy override. It appears it is not invoked sometimes during add-on uninstallation. Moreover, rarely it starts flooding to log every second.
The question is - is there some sort of detailed documentation on add-on and its created objects lifecycle? Is there any way to ensure code written in lifecycle hooks is always executed? Thanks in advance for the response.