slackapi / bolt-python

A framework to build Slack apps using Python

Home Page:https://slack.dev/bolt-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enable_token_revocation_listeners() is not invoking unistallation method of a custom installation store

rahul-beehyv opened this issue · comments

I'm trying to unistall a bolt app via Slack admin interface. I've enabled token revocation listeners using this statement

app.enable_token_revocation_listeners()
But its not calling the delete installation methods defined in my custom installation store. It wasn't raising any error as well.

I tried using event decorator with "app_uninstalled" as well, but wasn't able to invoke it again.

@app.event("app_uninstalled")
async def uninstall(context: AsyncBoltContext):
    await CustomInstallationStore.async_delete_installation(enterprise_id=context.enterprise_id,team_id=context.team_id)

What should be the correct way to do this?

Reproducible in:

The slack_bolt version

slack-bolt==1.18.1
slack_sdk==3.27.1

Python runtime version

Python 3.9.16

OS info

Steps to reproduce:

1.Initialise slack bolt app with a custom installation store and implement delete_installation method.
2. Enable token revocation listener.
3. Unistall the app.

Expected result:

Should execute the delete_installation function defined in custom installation store

Actual result:

Not being invoked

Hi, @rahul-beehyv! Thank you for submitting this question 😄

Based on what you described, I'm wondering if your app is picking up on the app_uninstalled event at all. Have you subscribed to that event for your app?

Hi @hello-ashleyintech ,
looks i didn't, sorry for the trouble and thank you !