slackapi / bolt-python

A framework to build Slack apps using Python
https://slack.dev/bolt-python/
MIT License
1.02k stars 236 forks source link

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

Closed rahul-beehyv closed 2 months ago

rahul-beehyv commented 2 months ago

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.

  1. Enable token revocation listener.
  2. Unistall the app.

Expected result:

Should execute the delete_installation function defined in custom installation store

Actual result:

Not being invoked

hello-ashleyintech commented 2 months ago

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?

rahul-beehyv commented 2 months ago

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