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

The 'value' property on ButtonAction is incorrectly typed #2133

Closed
w33ble opened this issue Jun 12, 2024 · 3 comments · Fixed by #2134
Closed

The 'value' property on ButtonAction is incorrectly typed #2133

w33ble opened this issue Jun 12, 2024 · 3 comments · Fixed by #2134
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Milestone

Comments

@w33ble
Copy link

w33ble commented Jun 12, 2024

@slack/bolt version

3.18.0

Your App and Receiver Configuration

N/A

Node.js runtime version

v20.12.2

Steps to reproduce:

It's simple enough to prove that the value isn't always there...

  1. Create a bot with Interactivity
  2. Create an Interactivity webhook
  3. Post a message on Slack with an Button Block action that does not contain a value
  4. Click on that button
  5. Note that the body sent to the webhook has a payload where the object in actions does not contain a value

Example payload where actions array with no value in the object (truncated and unique identifiers changed):

{
  "type": "block_actions",
  // ...
  "actions": [
    {
      "action_id": "abc123",
      "block_id": "def456",
      "text": {
        "type": "plain_text",
        "text": "Hello World",
        "emoji": true
      },
      "type": "button",
      "action_ts": "1234567890.123456"
    }
  ]
}

Expected result:

The ButtonAction type should indicate that the value field is optional

Actual result:

The ButtonAction type indicates that the value field will always contain a string

See the type here.

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@srajiang
Copy link
Member

Good find @w33ble, and thanks for reporting this!

Looks like the documentation for Button block action payload is also consistent with value not being required. Got a fix here.

@srajiang srajiang added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented and removed untriaged labels Jun 12, 2024
@w33ble
Copy link
Author

w33ble commented Jun 12, 2024

@srajiang thanks for the quick fix! Looking forward to 3.19.0 being released. 👍🏾

@zimeg zimeg added this to the 3.19.0 milestone Jun 19, 2024
@zimeg
Copy link
Member

zimeg commented Jun 19, 2024

👋 Hey @w33ble! This fix should be available now with the latest v3.19.0 changes! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants