Skip to content
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

[FEATURE] Allow remote debugging slack run #274

Open
spoike opened this issue Feb 12, 2024 · 5 comments
Open

[FEATURE] Allow remote debugging slack run #274

spoike opened this issue Feb 12, 2024 · 5 comments
Labels
feature request New feature or request

Comments

@spoike
Copy link

spoike commented Feb 12, 2024

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 the slack 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 as BlockActionHandler and ViewSubmissionHandler) 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! 🤘

@hello-ashleyintech hello-ashleyintech added the feature request New feature or request label Feb 12, 2024
@hello-ashleyintech
Copy link

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! 🙇

@anthonygualandri
Copy link

@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!

@WilliamBergamin
Copy link
Contributor

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 and ViewSubmissionHandler) 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?

@spoike
Copy link
Author

spoike commented Feb 26, 2024

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 [QUERY] Is it possible to get a log on what failed in a view submission handler for a modal view #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. 😅

@nicholastettenborn
Copy link

+++ on the requirement for a Step debugger. I am very surprised that no devs have requested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants