slack-go/slack

socketClient fails to push a view with larger payload

Nizar-opt opened this issue · 0 comments

What happened

Our app is using socketmode interactive events to push/update views (modals). Recently, i added one more option to one of the select input fields, then the app started to fail on pushing new views, once i remove that option it gets back to normal operation. I thought that I'm hitting a limit of the number of options but other fields have way more options, so i guess it might be related to the overall size of the payload? I checked the logs, there were no errors, it shows that the payload has been sent to slack:

socketmode: 2023/04/25 14:35:57 socket_mode_managed_conn.go:311: Sending Socket Mode response with envelope ID "5b57b603-5960-4bfa-becf-deae754e6674": &{5b57b603-5960-4bfa-becf-deae754e6674 0xc00007a5a0}
socketmode: 2023/04/25 14:35:57 socket_mode_managed_conn.go:320: Finished sending Socket Mode response with envelope ID "5b57b603-5960-4bfa-becf-deae754e6674"

Expected behavior

just to push a new view or at least throw an error if there is something wrong with the payload

Steps to reproduce

reproducible code

# payload
{
    "envelope_id": "xxxxxxxxxxxxxxxxxxxxxxx",
    "payload": {
        "response_action": "push",
        "view": {
            "type": "modal",
            "title": {
                "type": "plain_text",
                "text": "Deploy K8S"
            },
            "blocks": [
                {
                    "type": "section",
                    "text": {
                        "type": "mrkdwn",
                        "text": "Enter parameters to deploy my-app"
                    }
                },
                {
                    "type": "divider"
                },
                {
                    "type": "input",
                    "block_id": "BRANCH",
                    "label": {
                        "type": "plain_text",
                        "text": "BRANCH"
                    },
                    "element": {
                        "type": "plain_text_input",
                        "action_id": "BRANCH",
                        "initial_value": "main"
                    }
                },
                {
                    "type": "input",
                    "block_id": "ENV_TARGET",
                    "label": {
                        "type": "plain_text",
                        "text": "ENV_TARGET"
                    },
                    "element": {
                        "type": "static_select",
                        "action_id": "ENV_TARGET",
                        "options": [
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "PRO"
                                },
                                "value": "PRO"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "CANARY"
                                },
                                "value": "CANARY"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "B"
                                },
                                "value": "B"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "C"
                                },
                                "value": "C"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "D"
                                },
                                "value": "D"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "E"
                                },
                                "value": "E"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "F"
                                },
                                "value": "F"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "G"
                                },
                                "value": "G"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "H"
                                },
                                "value": "H"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "R"
                                },
                                "value": "R"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "S"
                                },
                                "value": "S"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "T"
                                },
                                "value": "T"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "TT"
                                },
                                "value": "TT"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "TTT"
                                },
                                "value": "TTT"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "TTTT"
                                },
                                "value": "TTTT"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "TTTTT"
                                },
                                "value": "TTTTT"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "U"
                                },
                                "value": "U"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "V"
                                },
                                "value": "V"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "W"
                                },
                                "value": "W"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "X"
                                },
                                "value": "X"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "Y"
                                },
                                "value": "Y"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "Z"
                                },
                                "value": "Z"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "ZZ"
                                },
                                "value": "ZZ"
                            }
                        ],
                        "initial_option": {
                            "text": {
                                "type": "plain_text",
                                "text": "PRO"
                            },
                            "value": "PRO"
                        }
                    }
                },
                {
                    "type": "input",
                    "block_id": "ENV_TYPE",
                    "label": {
                        "type": "plain_text",
                        "text": "ENV_TYPE"
                    },
                    "element": {
                        "type": "static_select",
                        "action_id": "ENV_TYPE",
                        "options": [
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "Auto-Detect"
                                },
                                "value": "Auto-Detect"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "STAGING-A"
                                },
                                "value": "STAGING-A"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "STAGING-B"
                                },
                                "value": "STAGING-B"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "STAGING-C"
                                },
                                "value": "STAGING-C"
                            },
                            {
                                "text": {
                                    "type": "plain_text",
                                    "text": "STAGING-DEV"
                                },
                                "value": "STAGING-DEV"
                            }
                        ],
                        "initial_option": {
                            "text": {
                                "type": "plain_text",
                                "text": "Auto-Detect"
                            },
                            "value": "Auto-Detect"
                        }
                    }
                }
            ],
            "close": {
                "type": "plain_text",
                "text": "Back"
            },
            "submit": {
                "type": "plain_text",
                "text": "Submit"
            },
            "private_metadata": "some private data less than 3000 chars xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

            "callback_id": "form",
            "notify_on_close": true
        }
    }
}
...
payload := slack.NewPushViewSubmissionResponse(&modalRequest)
socketClient.Ack(*event.Request, payload)
...

manifest.yaml

display_information:
  name: MR_Deployer
  description: deploys apps
  background_color: "#4f639e"
features:
  bot_user:
    display_name: MR_Deployer
    always_online: false
  slash_commands:
    - command: /deploy
      description: "deploys apps "
      should_escape: false
oauth_config:
  scopes:
    bot:
      - chat:write
      - channels:join
      - commands
settings:
  interactivity:
    is_enabled: true
    request_url: xxxxxxxxxxxxxxxxxxxxx
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false

Versions

  • Go: 1.20
  • slack-go/slack: v0.12.2