-
Notifications
You must be signed in to change notification settings - Fork 394
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
Missing possible null
type for value for PlainTextInputAction and StaticSelectAction types
#1914
Comments
@GovernmentHack I'm trying to reproduce this issue in an actual app and not block kit builder.
I am unable to reproduce this, in either a modal or a message posted by the app. No
Also unable to reproduce this mainly because there is no option to 'clear selection' in a static select menu, either embedded in a modal or in a message. I think this may end up being an issue submission for block kit builder than for bolt 😄 Let me know what you think. |
O geez, absolutely my bad, nope, I was testing without |
I'll take a note to validate/reproduce the payloads with the DatePicker element and file an issue if there's a problem with that.
Wait.. is it
The bad news is that with the input either embedded in the blocks of a message OR in a modal, with the above, neither of the events get dispatched 😬 I will file this with the API team in charge... |
Here is the output of my screenshotted element using the Slack dev tools: {
"bot_id": "<REDACTED>",
"type": "message",
"text": "Testing Message content <REDACTED> slack ",
"user": "<REDACTED>",
"ts": "1690469581.860159",
"metadata": {
"event_type": "<REDACTED>",
"event_payload": {}
},
"app_id": "<REDACTED>",
"blocks": [
{
"type": "section",
"block_id": "reply_message",
"text": {
"type": "mrkdwn",
"text": "Testing Message content <REDACTED> slack\n",
"verbatim": false
}
},
{
"type": "input",
"block_id": "<REDACTED>",
"label": {
"type": "plain_text",
"text": "Move from",
"emoji": true
},
"optional": false,
"dispatch_action": true,
"element": {
"type": "plain_text_input",
"action_id": "<REDACTED>",
"placeholder": {
"type": "plain_text",
"text": "Write something",
"emoji": true
},
"dispatch_action_config": {
"trigger_actions_on": [
"on_enter_pressed"
]
}
}
}
],
"team": "<REDACTED>",
"bot_profile": {
"id": "<REDACTED>",
"deleted": false,
"name": "<REDACTED> Staging Slack App",
"updated": 1683521047,
"app_id": "<REDACTED>",
"icons": {
"image_36": "<REDACTED>",
"image_48": "<REDACTED>",
"image_72": "<REDACTED>"
},
"team_id": "<REDACTED>"
},
"thread_ts": "1690405013.555419",
"parent_user_id": "<REDACTED>"
} Interestingly the block contains both dispatch action configs. But, I definitely only sent the |
Oh wow that is confusing as heck haha. So I commented out the element-level However, back to your original issue: pressing enter on an empty input doesn't dispatch an action and in fact the client will render a red outline on the input with a "Please complete this required field." error. Therefore, it seems to me like |
Nope, that sounds good to me. I appreciate the help testing this! I guess next steps are to file an issue with the block kit builder app to remove the "Clear Action" and remove the ability to send null values 😅 Thanks for the help with this! |
Indeed, I've filed two more issues with the Block Kit team to address the two Block Kit Builder issues we've identified. Happy to help! I am appreciative of your patience, responsiveness and for correcting my mistakes as we worked through this. I will close this issue down now but if there's anything else, feel free to re-open or to file another issue. |
Reproducible in:
Using the block builder actions preview:
When triggering a block action event, some actions have a
null
value possible state. However, the Types defined in https://github.com/slackapi/bolt-js/blob/main/src/types/actions/block-action.ts do not accommodate possible null values.For example, the
PlainTextInputAction
type can have a null value when you press enter to dispatch the action with nothing filled:Or, the
StaticSelectAction
can have a null value if after a value is selected, the user selects "clear selection":The Slack SDK version
"slack/bolt": "3.13.2",
"slack/logger": "^3.0.0",
"slack/oauth": "^2.6.1",
"slack/socket-mode": "^1.3.2",
"slack/types": "^2.8.0",
"slack/web-api": "^6.8.1",
Node.js runtime version
v18.12.1
OS info
ProductName: macOS
ProductVersion: 13.4.1
ProductVersionExtra: (c)
BuildVersion: 22F770820d
Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
Steps to reproduce:
(Share the commands to run, source code, and project settings)
null
(for example, in a test for a block action handler)Expected result:
No error
Actual result:
Type error:
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.
The text was updated successfully, but these errors were encountered: