node-slack-sdk
node-slack-sdk copied to clipboard
Incorrect type: `ActionsBlock['elements']` erroneously allows values of `Multi*Select` interfaces
Description
The ActionsBlock
interface has an elements
property of type (Button | Overflow | ... | Action)[];
. All Multi*Select
interfaces extend the Action
interface. Therefore, according to the types, it is a valid action element.
However, in actuality, MultiSelects are not supported as elements in action blocks, per this reference. This leads to an error at run time when making the API call, even though it passes at compile time.
What type of issue is this? (place an x
in one of the [ ]
)
- [x] bug
- [ ] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] testing related
- [ ] discussion
Requirements (place an x
in each of the [ ]
)
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Packages:
Select all that apply:
- [x]
@slack/web-api
- [ ]
@slack/events-api
- [ ]
@slack/interactive-messages
- [ ]
@slack/rtm-api
- [ ]
@slack/webhooks
- [ ]
@slack/oauth
- [ ]
@slack/socket-mode
- [ ] I don't know
Reproducible in:
package version:
node version:
OS version(s):
Steps to reproduce:
- Use a
Multi*Select
value as an element within theelements
property ofActionsBlock
- See it passes at compile time, but fails at run time as
Multi*Select
blocks aren't supported as Actions
Expected result:
For a type error to raise at compile time
Actual result:
No error until the failed API call is made
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
Hi @rr-codes, thanks (as always) for taking the time to flag this! We have not checked this in detail but at first glance, you are right. This can be improved in the future versions.
This is no longer a bug - not sure when it was resolved, but our docs now show Multi-Select elements being supported in Action blocks, and I verified that the backend schema allows this, too. Closing.