Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.21.4 breaks slash commands in socket mode #1265

Closed
kpaulisse opened this issue Feb 20, 2024 · 0 comments · Fixed by #1266
Closed

Release 0.21.4 breaks slash commands in socket mode #1265

kpaulisse opened this issue Feb 20, 2024 · 0 comments · Fixed by #1266

Comments

@kpaulisse
Copy link
Contributor

kpaulisse commented Feb 20, 2024

What happened

As of version 0.21.4, Slash commands do not work correctly in socket mode (resulting in "dispatch failed" in the client). This is a regression since version 0.21.3.

Expected behavior

Slash commands should work correctly in all versions.

Steps to reproduce

When using Socket mode on a non-enterprise instance, this is the payload when typing /mycommand foobar (with lots of redactions):

{
    "envelope_id": "e16988f4-ac45-4b4a-93b4-1851a6f77e6d",
    "payload": {
        "token": "XXX",
        "team_id": "T0000000000",
        "team_domain": "my-workspace",
        "channel_id": "C000000000000",
        "channel_name": "my-channel",
        "user_id": "U0000000000",
        "user_name": "My name here",
        "command": "/mycommand",
        "text": "foobar",
        "api_app_id": "A000000000",
        "is_enterprise_install": "false",
        "response_url": "https://hooks.slack.com/commands/A000000000/00000/XXXXX",
        "trigger_id": "00000.00000.00000"
    },
    "type": "slash_commands",
    "accepts_response_payload": true
}

The problem here is that #1255 adds a new IsEnterpriseInstall field with type boolean, whereas in the payload this is a string (e.g. "false"). Therefore the parsing of the JSON fails and the slash command handlers don't ever get invoked.

reproducible code

manifest.yaml

Versions

  • Go: 1.22.0
  • slack-go/slack: 0.21.4
@kpaulisse kpaulisse changed the title Release 0.21.4 breaks slash commands in websocket mode Release 0.21.4 breaks slash commands in socket mode Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant