Inconsistent SlackObjectFormationError raising when empty text is provided.
@hello-ashleyintech đang làm issue này rồi.
Từ ngày 20/9/2022.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Given the following:
>>> SectionBlock(text="").to_dict()
SlackObjectFormationError: text or fields attribute must be specified
This is all correct enough and good enough. What's happening behind the scenes appears to be that TextObject.parse is used and does a truthy test on the incoming text, and returns None as opposed to an empty string.
Where that begins to go wrong, is here:
>>> SectionBlock(text=MarkdownTextObject(text="")).to_dict()
{'text': {'type': 'mrkdwn'}, 'type': 'section'}
Slack will reject that as erroneous. If it's sent back as part of the acknowledgement response as a response_action we won't necessarily see (receive) an error related to failing to parse the JSON schema. Slack's block kit builder says of it: Missing required field: text
Category
- slack_sdk.models (UI component builders)
Desired outcome
Ideally, I'd like to be able to trust (more) that the validation present in slack_sdk is going to raise on invalid configurations early, and consistently -- that is, where possible I'd like to assume that putting together something "empty" even if I've opted to use the classes instead of an equivalent base type (str, dict) should raise.
- Ngôn ngữ chính
- Python
- Star
- 4k
- Fork
- 857
- Merge trung bình
- 22 giờ 21 phút
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của slackapi/python-slack-sdk
-
needs info server-side-issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
slackapi/python-slack-sdk#1961 · 3 bình luận ·
-
Use logger.isEnabledFor(logging.DEBUG) instead of logger.level <= logging.DEBUG for debug guards Đang mởauto-triage-skip bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
slackapi/python-slack-sdk#1957 ·
-
auto-triage-skip discussion
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
slackapi/python-slack-sdk#1940 · 2 bình luận ·
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel Đang mởauto-triage-skip enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
slackapi/python-slack-sdk#1923 · 2 bình luận ·
-
SocketModeClient.connect() retries forever against a permanently closed aiohttp ClientSession Đang mởauto-triage-skip bug socket-mode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
slackapi/python-slack-sdk#1922 · 2 bình luận ·
Tất cả issue của slackapi/python-slack-sdk
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100