slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno

Home Page:https://api.slack.com/automation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QUERY] Is it possible to get a log on what failed in a view submission handler for a modal view

spoike opened this issue · comments

Question

Is there a way to get a log during slack run on why a ViewSubmissionHandler failed using the response_action method?

It currently does not print any errors on the log output while trying to update the modal view.

Context

I'm building a step-by-step interactive modal view. In some instances I can't update a view using the following return:

return {
  response_action: "update",
  view: outputView // newly made view for the modal
};

This fails "quietly", as in there is no error in the log output. Instead the modal is not updated and the following error message is shown:

We had some trouble connecting. Try again?
Screenshot with error message

However updating the view via the client object works and it is with the exact view!

client.views.update({
  view_id: view.id, // view is the previous one from the view submission  payload
  view: outputView
})

Unfortunately the modal closes when there is no return. You can return the same thing after this Slack API Client call, the view will update but the response_action will still fail and show the error message.

Coincidentally the same view works in the BlockActionsHandler using the Slack API Client.

Environment

    "deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.5.0/",
    "deno-slack-api/": "https://deno.land/x/deno_slack_api@2.1.2/",
deno 1.39.4 (release, x86_64-apple-darwin)
v8 12.0.267.8
typescript 5.3.3
ProductName:            macOS
ProductVersion:         14.2.1
BuildVersion:           23C71
Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:10 PST 2023; root:xnu-10002.61.3~2/RELEASE_X86_64

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 thing. 🤘

Hi, @spoike! Thanks for your question! ✨

For general logging for your app, I recommend taking a look at this resource. This guide walks through how to use both function-level and app-level logging to troubleshoot and debug your app.

Let me know if you have additional questions or if this is not what you were looking for!

Thanks.

However I'm not asking about function-level or app-level logging. This is about getting any error log from Slack's backend (in context why the response_action method fails) for which the linked resource does not include. This could also happen to be a bug on Slack CLI.

There is an --activity-level flag for slack run but that one does not yield any error log either.

@spoike Ah, I see! Have you tried seeing if the log appears when you run the slack activity command? This will display general app activity logs and should capture any app errors thrown by the app.

If not, then let me know and we can figure out how to get you the logs you need!

I've checked slack activity command but unfortunately no errors are logged when views fail to update.

Thanks for the update, @spoike! Let me check with the team internally to see if there's a way to log these errors, and I'll get back to you! 🙇

@spoike Quick question - is the We had some trouble connecting. Try again? error consistent or is it only happening sporadically?

It is consistent