Open spoike opened 6 months ago
Hi, @spoike! Thanks so much for the feature request! 🙌
I have passed this along to our Deno team - they're currently OOO, so it may take at least a week to get a response, but I have surfaced it and they'll get back to it whenever possible! 🙇
@hello-ashleyintech Also interested in being able to debug remotely in a local editor env like @spoike described. If this is not possible, is there some guidance on making debugging in local test mode easier in a similar way? Thanks!
Hi @spoike and @anthonygualandri thanks for writing in 💯
We have explored the idea of introducing a slack run --debug
mode using the --inspect
and --inspect-brk
flags
Unfortunately this resulted in an unstable developer experience since the CLI is designed to mimic a lambda invocation by spawning Deno processes for each request, this behavior proved to be incompatible with the V8inspector clients since they were not designed to handle multiple short lived Deno "debug" processes
At the time no developers had asked for debug support therefore we stopped our work on it. This seems to be the first request for it 🥇
is there some guidance on making debugging in local test mode easier in a similar way?
There was no simple way to set up debug mode locally, we were only able to debug the first request sent by Slack to an application and this was still unstable. But let me know if you would like some information on how you could tests this out?
However some payloads are nested (such as
BlockActionHandler
andViewSubmissionHandler
) which get truncated by the console logger which this alternative cumbersome to do
Allowing console logging of BlockActionHandler
and ViewSubmissionHandler
might be a lower lift short term solution let me know if it would help?
Hi @WilliamBergamin thanks for answering. What prompted this feature request for me personally was two issues that I was having that would've cleared up with some debugging:
I've reported one of them in #275 as I couldn't see why the response action for a ViewSubmissionHandler
would fail with some view payloads (where the exact same view payload was valid when sent through the Slack Client API instead). So it would've been nice to see under the hood where it failed silently. For now I had to redesign the modal form to use smaller view payloads (i.e. the workaround is to cut out the part of the payload that would fail, cross your fingers it would work in another view).
The other issue is that it is difficult with typescript types to see what the function arguments contain since it is a very nested object that the current Typescript types likes to boil down to any
type, which is not ideal.
Allowing console logging of BlockActionHandler and ViewSubmissionHandler might be a lower lift short term solution let me know if it would help?
Being able to see the whole function argument is a nice-to-have feature for sure. But it is not that particularly necessary because you can console log some of the nested stuff yourself separately. The "cumbersome" part here is that you need to restart and retry every time you need to change the logging.
The more wild idea is to allow interactivity with the program through some ncurses-like window to set up debug watches on some variables/arguments... but then we're talking about writing your own debugger which I'm pretty sure is out of scope for slack run
. 😅
+++ on the requirement for a Step debugger. I am very surprised that no devs have requested it.
Description of the problem being solved
I find myself in situations while developing a Slack app that I need to check what payloads are being sent into functions etc. Deno supports remote debugging via V8 Inspector protocol, unfortunately these flags (
--inspect
or--inspect-brk
) can't be passed via theslack run
command.Alternative solutions
The workaround is that you can log variables directly to the output with
console.log
(poor man's debugging). However some payloads are nested (such asBlockActionHandler
andViewSubmissionHandler
) which get truncated by the console logger which this alternative cumbersome to do.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.
Sure, lets go! 🤘