slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
155 stars 27 forks source link

[BUG] Closing a form should not log errors #280

Closed tomas-zijdemans-vipps closed 6 months ago

tomas-zijdemans-vipps commented 6 months ago

I noticed that when I use the built-in OpenForm function Schema.slack.functions.OpenForm in a workflow, errors are logged if the form is closed by the user.

Steps:

  1. User triggers the workflow
  2. A form is displayed
  3. User clicks the "Close" X button in the upper right corner
  4. Slack logs errors (see below)

Expected outcome: Closing a form should not log errors, this is normal user behaviour. It should probably just be a "Info" level log message.

2024-02-21 10:13:13 [error] [Fn010N] (Trace=Tr06KVMVE2AF) Function 'Collect info in a form' (Slack function) failed
    user_closed_form
2024-02-21 10:13:14 [error] [Wf06KFKK0B5G] (Trace=Tr06KVMVE2AF) Workflow step 'Collect info in a form' failed
2024-02-21 10:13:14 [error] [Wf06KFKK0B5G] (Trace=Tr06KVMVE2AF) Workflow 'Post errors for a specific MSN' failed
    user_closed_form
2024-02-21 10:13:14 [error] [Fn06K90WLP5L] (Trace=Tr06KVMVE2AF) Function 'Post errors for a specific MSN' (workflow function) failed
    user_closed_form
WilliamBergamin commented 6 months ago

Hi @tomas-zijdemans-vipps thanks for reporting this 💯

I was able to reproduce this with the following steps

  1. slack create test-form-close -t https://github.com/slack-samples/deno-issue-submission
  2. cd test-form-close/
  3. slack run & create the triggers
  4. past the shortcut trigger in slack
  5. run the workflow
  6. When the from opens close it

I get the following error log

2024-02-21 11:38:25 [error] [Fn010N] (Trace=Tr06KYGW3FS7) Function 'Collect info in a form' (Slack function) failed
    user_closed_form
2024-02-21 11:38:25 [error] [Wf06LB9A4DGR] (Trace=Tr06KYGW3FS7) Workflow step 'Collect info in a form' failed
2024-02-21 11:38:25 [error] [Wf06LB9A4DGR] (Trace=Tr06KYGW3FS7) Workflow 'Submit an issue' failed
    user_closed_form
2024-02-21 11:38:25 [error] [Fn06LMD59R24] (Trace=Tr06KYGW3FS7) Function 'Submit an issue' (workflow function) failed
    user_closed_form

I will report this internally find out if these is new behavior

srajiang commented 6 months ago

@tomas-zijdemans-vipps - Following up here, we've confirmed that this is in fact new behavior, but I agree with your reasoning that this seems more correctly an "Info" level log message. Working on getting some more detail here from the Backend teams that implemented the change.

srajiang commented 6 months ago

@tomas-zijdemans-vipps - Following up as promised; the current behavior helps us distinguish between workflows that are waiting for user action vs aborted by user vs stuck due to unknown issues. I've given the feedback internally that the scenario of closing a form would be more useful as an info-level statement but for now, I don't have much else to report on this, so I'm going to close this issue up!