Hi
Based on this Blog i implemented in my index.js the following code see below.
addon.on('host_settings_saved', function (clientKey, settings) { console.log('host_settings_saved'); //<-- OK }); addon.on('installed', function(clientKey, clientInfo, req){ console.log('installed'); //<-- NOT OK }); addon.on('uninstalled', function(clientKey, clientInfo, req){ console.log('uninstalled'); //<-- NOT OK });
The Connect Addon Descriptor looks like that:
"lifecycle": { "installed": "/installed", "uninstalled": "/uninstalled" },
After the installation of the addon i get this terminal log with http status code 204:
POST /installed?user_key=12345 204 45.760 ms
But during the uninstall-process i get a terminal log with http status code 404:
POST /uninstalled?user_key=12345 404 23.576 ms
Why the eventlistener doesn't work for the uninstall eventType?
Thank you & Regards
Community moderators have prevented the ability to post new answers.
Hi Lutz,
addon.on
registers listeners for events raised by the addon
object. It doesn't emit any events called uninstalled
or installed
. The installed / uninstalled lifecycle webhooks are a completely different mechanism, and you hook into those by registering routes on the app. The atlassian-connect-express
library does this for /installed
which is why you can see a 204 for that one. To register your own:
app.post('/uninstalled', addon.authenticate(), function (req, res) { ... });
Hope that helps,
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.