"Sorry, this didn't work" error with working Message Shortcut
See original GitHub issueHello Slack! I am building Slack app according to your documentation (https://api.slack.com/surfaces/modals/using#modal_response_url) and I have an issue with Slack Message Shortcut. It works almost fine, when I create modal.open - it opens modal window with proper elements. But in Slack application window appears Error in lower right corner “Sorry, this didn’t work. Try again?”. Furthermore everything works fine and I don’t get any errors in logs on my server side. I wondering how to remove this error message. Do I need to send any additional response to Slack server when I execute message shortcut?
In mobile ios application everything works without any additional Errors.
Preview: https://imgur.com/Ag3KcBq
Reproducible in:
def form_and_push_msg_modal(payload):
# Forming view
payload = {
"token": slack_token,
"trigger_id": payload["trigger_id"],
"view": view_str,
}
r = requests.post("https://slack.com/api/views.open", data=payload, timeout=1)
r.raise_for_status()
if payload["type"] == "message_action":
form_and_push_msg_modal(payload)
The Slack SDK version
slackclient==2.8.2
Python runtime version
Python 3.8.2
OS info
Linux semu 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Steps to reproduce:
- Parse with any library request from Slack if payload[“type”] == “message_action”:
- Return any result, even empty body return
Expected result:
Same as I get, but Error message doesn’t appear in slack application.
Actual result:
INFO: 52.23.240.52:0 - "POST /slack/interactions HTTP/1.1" 200 OK
[INFO] slack.reactions (Source: slack/reactions.py:61, Time: 2020-09-17 02:53:13,226) - Slack conversation info response
[INFO] slack.interactions (Source: slack/interactions.py:663, Time: 2020-09-17 02:53:14,376) - SHORTCUT: create-msg
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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Modifying the lines should work for you.
Just in case, I verified this sample works with message shortcuts. I didn’t see any issues.
If your
views.open
API calls result in{'ok': False, 'error': 'invalid_arguments', 'response_metadata': {'messages': ['[ERROR] invalid
trigger_id[json-pointer:/trigger_id]']}}
, make sure your access token (=SLACK_API_TOKEN
in this sample).It’s great to know you’ve figured out the cause. Let me close this issue now.