New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app_home_opened event never fires handler #308
Comments
I have, actually. Tested by adding the subscription to the "bot events", "workspace events", and both at once. If I intercept the requests being made I see Slack posting the event to my address, but the bot doesn't receive it. |
@kroltan could you post a snippet of your handler logic? |
Sure! It's copied straight from the doc example: app.event("app_home_opened", async ({ context, event, say, ack }) => {
ack();
// check the message history if there was a prior interaction for this App DM
const history = await app.client.im.history({
token: context.botToken,
channel: event.channel,
count: 1 // we only need to check if >=1 messages exist
});
// if there was no prior interaction (= 0 messages),
// it's save to send a welcome message
if (!history.messages.length) {
say("Hia");
}
}); But even a simpler one like below is never invoked. app.event("app_home_opened", async ({ ack }) => {
ack();
console.log("Blah");
}); |
The event URL is set up properly, as I stated earlier:
|
I just tested this event. It fires as expected
I highly doubt that it matters, but I run bolt 1.4.0 |
When testing locally I noticed that |
Hi again! I'll try to test this further as @TK95 asked, but as many, my end of year schedule is pretty busy, might only have actual time to test this after the turn of the year. Sorry for the inconvenience.
Nice catch, but if that was the issue wouldn't Bolt still log the event and at least throw the runtime error once the called |
@kroltan Yep it looks like yours is failing before it gets a chance to respond. |
👋 I hope you're having a wonderful time. I'd like to suggest two things for this question.
If you use ngrok, you can check the requests on its screen. Having the following middleware in your Bolt app also may be helpful to check what requests came in. app.use(args => {
console.log(JSON.stringify(args.body, null, 2));
args.next();
});
This is already mentioned above but |
@kroltan Hello, are you still having this issue? Just doing the following should work for you.
Let me know when you have any updates on this. If you already addressed this or are no longer working on this, close this issue. |
Hi! Sorry for the very long silence. Yes I am still seeing it. This is probably an issue with my hosting then, because with both the logging snippets @seratch recommended, I don't see any request coming in from Slack when I open the app home (though I do when I use a slash command). I also tried the With previous interception I could see Slack itself sending the requests, so it's clearly something between Slack and Bolt that is dropping it, not necessarily fault of either. I'll close this for now and investigate with the hosting, if necessary I can reopen this later. |
I have the same issue now. App home events worked yesterday in my app, but the event doesn't fire today. It looks like the event is not sent at all. If you need info for debugging, I was expecting "app_home_opened" event sent to "https://df1e-185-186-152-216.eu.ngrok.io/slack/events" endpoint at 2023-01-23 19:47 UTC time. =====EDIT======= |
In case it helps anyone else out: I had the same issue and it was driving me mad. I was receiving events as confirmed my ngrok, and bolt was seeing them because I hacked my |
Description
Even after following the proper instructions to enabling App Home, it is impossible to listen to the
app_home_opened
, and thus not possible to use App Home with Bolt.What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
Steps to reproduce:
app_home_opened
with a simpleconsole.log("Hi")
;Optionally, forward your bot through a logger/webhook inspector to see the transactions.
Expected result:
Handler to be fired.
Actual result:
Handler is not fired, despite webhook being called.
Attachments:
I've contacted Slack support and they helped debug this issue, See attached text transcript for everything we tested: slack_support_logs.txt
The text was updated successfully, but these errors were encountered: