slackapi / bolt-js

A framework to build Slack apps using JavaScript
https://tools.slack.dev/bolt-js/
MIT License
2.75k stars 393 forks source link

Unable to submit modal with rich_text_input field #2266

Closed chizzydavid closed 1 month ago

chizzydavid commented 1 month ago

I'm having this issue with rich_textinput on a modal, when I set the initial values of the input field with a message that includes a reference to a workspace channel as seen on the screenshot and I try to submit. I get the 'We had some trouble connecting...'_ error

Screenshot 2024-09-19 at 12 22 36

And after I submit the modal without any changes, I get this on the web console. I think somehow while the modal renders the channel_id field is changed to channelId

Group 2 (1)

This is the payload displaying the modal


  "title":{
     "type":"plain_text",
     "text":"Onboarding Message"
  },
  "type":"modal",
  "submit":{
     "type":"plain_text",
     "text":"Save"
  },
  "callback_id":"new_onboarding_msg_modal",
  "close":{
     "type":"plain_text",
     "text":"Cancel"
  },
  "blocks":[
     {
        "type":"input",
        "block_id":"text-content",
        "element":{
           "type":"rich_text_input",
           "action_id":"onboardingContent",
           "initial_value":{
              "type":"rich_text",
              "elements":[
                 {
                    "type":"rich_text_section",
                    "elements":[
                       {
                          "type":"text",
                          "text":"Hello world! "
                       },
                       {
                          "type":"channel",
                          "channel_id":"C02UHCKRCAD"
                       }
                    ]
                 }
              ]
           }
        },
        "label":{
           "type":"plain_text",
           "text":"Add message",
           "emoji":true
        }
     },
     {
        "label":{
           "type":"plain_text",
           "text":"Direct message sent from"
        },
        "block_id":"admin_message_trigger",
        "element":{
           "action_id":"onboard_message_from_options",
           "options":[
              {
                 "text":{
                    "type":"mrkdwn",
                    "text":"Your profile"
                 },
                 "value":"admin"
              },
              {
                 "text":{
                    "type":"mrkdwn",
                    "text":"Cosy bot"
                 },
                 "value":"cosy_bot"
              }
           ],
           "initial_option":{
              "text":{
                 "type":"mrkdwn",
                 "text":"Your profile"
              },
              "value":"admin"
           },
           "type":"radio_buttons"
        },
        "type":"input"
     }
  ]
}```
filmaj commented 1 month ago

Thanks for the detailed report. This is the same issue as https://github.com/slackapi/bolt-js/issues/2138. I will keep it open and ping the team internally again for an update on this issue.

In the mean time, you can e-mail feedback@slack.com and reference both this issue and https://github.com/slackapi/bolt-js/issues/2138, and let them know you are affected by it. It can help to put pressure to prioritize fixing this bug.

chizzydavid commented 1 month ago

Thank you. Would forward this to the email as well.

filmaj commented 1 month ago

Hello! The fix for this has been rolled out to all Slack plans now. Going to close this issue down.