Closed kadosh1000 closed 5 months ago
Ok, so I found the issue and the steps to fix it. There were 2 issues with just copy-pasting the example:
if using the find_bot
function instead of find_installlation
then you should put to the app properties installation_store_bot_only=True
Apparently there was an exception thrown because my implementation of AsyncInstallationStore:async_find_bot
function, did not have the is_enterprise_install
optional parameter. So the function signature will look like:
async def async_find_bot( self, *, enterprise_id: Optional[str], team_id: Optional[str], is_enterprise_install: Optional[bool] ) -> Optional[Bot]:
I recommend to update the examples using custom AsyncInstallationStore
Thank you so much for reporting the issue, and we're sorry for the disruption you encountered. I just updated the example code to resolve it.
I am trying to use bolt-python asyncly using FastAPI and sqlalchemy (using Postgres). I basically took this sqlalchemy example and just replaced
Sanic
withFastAPI
.Installation and redirect works well, and I also see the installations being added to Postgres, and I can also see events coming in through ngrok. But the events are not being processed and instead I get the message:
I tried reinstalling the app to the workspace multiple times, but I still continue to get this error.
I also tried debugging the
AsyncInstallationStore
and it seems that theasync_find_bot
function never triggers, so I am not sure where exactly to look why its not getting there.Edit: After some more digging into the code, it seems to be probably related to the
AsyncInstallationStoreAuthorize
. It looks like it is trying to useasync_find_installation
even though it was not implemented by my installation store, probably because it is extendingAsyncInstallationStore
class. Anyway to go around it?Reproducible in:
The
slack_bolt
versionslack-bolt==1.18.1 slack_sdk==3.27.0
Python runtime version
3.10.12
OS info
ProductName: macOS ProductVersion: 13.4.1 ProductVersionExtra: (c) BuildVersion: 22F770820d Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64
Steps to reproduce:
Sanic
withFastAPI
/slack/install
Expected result:
The event should go through the request handler and trigger the relevant event handle (i.e
@app.event("message")
)Actual result:
When an event is being sent to the app using
POST /slack/events
, it responds with 200 with the message:Also I can see this error in my console:
Although the app should be installed into this workspace, the AuthorizeResult (returned value from authorize) for it was not found.