-
Notifications
You must be signed in to change notification settings - Fork 29
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
[BUG] 'addBlockActionsHandler' not triggered and 'event_dispatch_failed' error if constructing Ocotokit #334
Comments
Hi, @oeed! Thanks for submitting your issue 😄 Consulted internally with the team and we wanted to see how long it's taking your |
I added timestamp logs and it appears the entire function only takes a little over a second to execute. Just in case I didn't explain properly initially, it fails purely from constructing the Another observation is that if you don't click an action button, i.e. just leave it, it also fails about 15 seconds later. So presumably it is actually timing out, even though I return from the function. Presumably Octokit is running something in the background, I'll try investigate what that might be.
Edit: Here's a minimum repro that is failing, link it up to a workflow triggered by a shortcut. Interestingly I get delayed import { DefineFunction, SlackFunction } from "deno-slack-sdk/mod.ts"
import { Octokit } from "https://esm.sh/[email protected]?dts"
export const OctokitFailureFunction = DefineFunction({
callback_id: "octokit_failure_function",
title: "Octokit Failure Function",
description: "Octokit Failure Function.",
source_file: "functions/ocotokit_failure.ts",
input_parameters: {
properties: {},
required: [],
},
output_parameters: {
properties: {},
required: [],
},
})
export default SlackFunction(OctokitFailureFunction, async () => {
console.log("Started", new Date())
new Octokit()
console.log("Ended", new Date())
return {
outputs: {},
}
})
|
Hey @oeed , sorry about the delay here, finally found some time to look into this. It seems the deno process is blocked when running the simple sample function you provided, that builds and creates an Took me a little bit to figure this out, but here's a test you can run on the function that exhibits the behaviour; run this from your app root and update the
When |
Looked into a workaround. I have good news and bad news. Good news! If you use Bad news 😬 I will push on Slack's side to fix the |
The
deno-slack
versionsdeno_slack_sdk: 2.12.0
deno_slack_api: 2.4.0
Deno runtime version
CLI: 2.26.0
deno: 1.44.4
typescript: 5.4.5
v8: 12.6.228.9
OS info
macOS 14.5
Describe the bug
I am building based off the 'time off approval' example and in my function I send a message with actions and
addBlockActionsHandler
. I am currently just running locally.If I initialise a
new Octokit
the function runs fine and creates a message, but when I click one of the action buttons the handler does not get called. The spinner appears for a few seconds and the workflow evidently fails with the following logs:However, if I simply comment out the Ocotokit constructor (but still leave the token async call) it works perfectly.
I get messages from Slackbot saying the workflow function failed to execute, but the log links it provides just leads to a blank page, I suspect related to #326. There aren't really any clues in
slack-debug-2024xx.log
either.It's worth noting that Ocotokit does work in the initial function and I can use it to make requests, but it's mere presence seems to kill the action handler.
Steps to reproduce
Here's an abridged version of my function, can provide more if wanted:
I do have
esm.sh
in myoutgoingDomains
. This is my first time working with the Deno ecoystem, so I'm not sure if there's something about the import being funky, etc.Expected result
I'd expect the action handler to be called.
Actual result
See above.
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
The text was updated successfully, but these errors were encountered: