ACE and uninstall lifecycle event

The documentation Connect frameworks and tools states for ACE (and AC spring):

These frameworks handle tasks like JWT authentication and signing, persistence of host details, installation and uninstallation callbacks,

However ACE does not handle the uninstall callback. There is an open issue Atlassian Connect Express (Node.js) - Issues - Ecosystem Jira , but it’s open since 2016.

Edit: opened issue Atlassian Connect Express (Node.js) - Issues - Ecosystem Jira

My question is: How to handle the uninstall callback? Any examples?

Tagging @acalantog @nmansilla @sven.schatter @rwhitbeck

It’s just another call where you do the .authenticate() call in the middleware:

In the descriptor:

 "lifecycle":
  {
	"installed": "/installed",
	"uninstalled": "/uninstalled"
  },

Then in the code:

   app.post('/uninstalled', addon.authenticate(), (req, res) => {
.. do stuff to delete things here ...
res.send(204)
})

Now that said - you probably don’t want to do anything seriously deletion in the /uninstalled hook. The best way to detect if an app has been removed from an instance is to poll the instances everyday and after X days of continuous lack of access (check for the license end point) - then declare that things has been removed and you can delete. (Or at least that’s what I’ve been told and haven’t heard anything to the contrary - @nmansilla @rwhitbeck @mpaisley - please correct me).

Now you can use the /uninstalled hook as an indicator that something should be removed - but it is still http so not guaranteed (there are a lot of devices between your service and Atlassian)…

3 Likes