slackapi / deno-slack-sdk

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

[BUG] Rich text inputs can't be submitted when user groups inputted #354

Closed peter-majeed closed 3 weeks ago

peter-majeed commented 3 weeks ago

The deno-slack versions

"deno-slack-sdk/": "https://deno.land/x/deno_slack_sdk@2.14.2/",
"deno-slack-api/": "https://deno.land/x/deno_slack_api@2.8.0/"

Deno runtime version

deno 1.45.5 (release, aarch64-apple-darwin)
v8 12.7.224.13
typescript 5.5.2

OS info

ProductName:            macOS
ProductVersion:         14.5
BuildVersion:           23F79
Darwin Kernel Version 23.5.0: Wed May  1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020

Describe the bug

Steps to reproduce

  1. Define a workflow with a rich text field.
const exampleWorkflow = DefineWorkflow({
  callback_id: "example_workflow",
  title: "Example workflow",
  description: "Example workflow",
  input_parameters: {
    properties: {
      currentUser: {
        type: Schema.slack.types.user_id,
      },
      currentChannel: {
        type: Schema.slack.types.channel_id,
      },
      currentTime: {
        type: Schema.slack.types.timestamp,
      },
      interactivity_context: {
        type: Schema.slack.types.interactivity,
        description: "Interactivity context",
      },
    },
    required: [
      "currentUser",
      "currentChannel",
      "currentTime",
      "interactivity_context",
    ],
  },
});

exampleWorkflow
  .addStep(
    Schema.slack.functions.OpenForm,
    {
      title: "Rich text example",
      submit_label: "Submit",
      interactivity: exampleWorkflow.inputs.interactivity_context,
      fields: {
        elements: [
          {
            name: "rich_text_example",
            title: "Rich text example",
            description: "Rich text example",
            type: Schema.slack.types.rich_text,
          },
        ],
        required: [
          "rich_text_example",
        ],
      },
    },
  );
  1. Use the input gathered in the rich_text_example element in the above workflow step to populate the initial value of a newly opened form to contain a user group.
    {
    "type": "modal",
    "title": {
    "type": "plain_text",
    "text": "Example"
    },
    "submit": {
    "type": "plain_text",
    "text": "Submit"
    },
    "callback_id": "example",
    "blocks": [
    {
      "type": "input",
      "block_id": "rich_text_example",
      "label": {
        "type": "plain_text",
        "text": "Rich text example",
        "emoji": true
      },
      "element": {
        "action_id": "rich_text_example",
        "type": "rich_text_input",
        "initial_value": {
          "type": "rich_text",
          "block_id": "aZk8MH68fe",
          "elements": [
            {
              "type": "rich_text_section",
              "elements": [
                {
                  "type": "usergroup",
                  "usergroup_id": "S00000000000"
                }
              ]
            }
          ]
        }
      },
    },
    ]
    }

Expected result

We should be able to submit the form without error.

image

Actual result

The slack form shows an error that cannot be recovered from. No errors are logged in the running app. image

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.

srtaalej commented 3 weeks ago

Hi @peter-majeed 👋 This is a limitation we’re aware of and we’re raising it to the team 🫡 , thank you for surfacing!

peter-majeed commented 3 weeks ago

@srtaalej is this issue the best way to watch for updates to this limitation?

srtaalej commented 3 weeks ago

We have a similar issue open where an update is more likely to get posted: https://github.com/slackapi/bolt-js/issues/2138

I recommend sending an email to feedback@slack.com and link to this issue and explain how it is a blocker for you - that will help prioritize the work to fix this.