`slack_file` image blocks appended with `chat.appendStream` render as missing images inline
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện chuỗi với files_upload_v2, files_info, chat_startStream, chat_appendStream và chat_stopStream bằng các phiên bản được liệt kê. So sánh payload yêu cầu của SDK với hành vi của API streaming của Slack và xác định liệu lỗi nằm ở SDK hay phía máy chủ. Công việc được xem là hoàn tất khi nguyên nhân được ghi lại và một bài kiểm thử hồi quy tập trung được thêm vào nếu xác định có thay đổi phía SDK.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When an image block referencing a Slack-hosted file is appended to a streaming message using chat.appendStream, Slack initially renders a missing-image placeholder.
Clicking the missing image opens and displays the correct image, which indicates that:
- The file ID is valid.
- The upload completed successfully.
- Slack generated the image thumbnail.
- The original image remains accessible.
The same streamed message's DOM contains a valid Slack thumbnail URL, but Slack replaces the inline background image with an unable-to-load-error asset.
This may be a server-side file-sharing/association issue specific to blocks appended through the streaming APIs.
Reproducible in:
The Slack SDK version
3.43.0
Bot scopes:
chat:writefiles:readfiles:write
Python runtime version
3.13.7
OS info
ProductName: macOS
ProductVersion: 26.6.2
BuildVersion: 25G83
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., pyproject.toml))
- Upload a PNG to Slack without posting a separate file message:
upload_response = await client.files_upload_v2(
content=png_bytes,
filename="sample.png",
)
file_id = upload_response["file"]["id"]
- Wait until files.info reports that the image and its thumbnail are ready:
file_info = await client.files_info(file=file_id)
file = file_info["file"]
assert file["mimetype"] == "image/png"
assert file["filetype"] == "png"
assert file["thumb_360"]
assert file["thumb_360_w"]
assert file["thumb_360_h"]
- Start a streaming message:
response = await client.chat_startStream(
channel=channel_id,
thread_ts=thread_ts,
)
stream_ts = response["ts"]
- Append an image block using the Slack file ID:
await client.chat_appendStream(
channel=channel_id,
ts=stream_ts,
chunks=[
{
"type": "blocks",
"blocks": [
{
"type": "image",
"slack_file": {
"id": file_id,
},
"alt_text": "Sample Image",
}
],
}
],
)
- Stop the stream:
await client.chat_stopStream(
channel=channel_id,
ts=stream_ts,
)
Expected result:
The Slack-hosted image should render inline in the completed streaming message.
Actual result:
Slack renders a missing-image placeholder.
Clicking the placeholder opens and displays the correct image.
Inspecting the rendered HTML shows that Slack resolved the file to a generated thumbnail URL:
<a
class="c-link c-message_attachment__image"
href="https://files.slack.com/files-tmb/.../chart_480.png"
style="
background-image:
url('https://a.slack-edge.com/.../unable-to-load-error-....png');
"
>
<span role="img" aria-label="missing image"></span>
</a>
The href points to the generated Slack thumbnail, while the inline background is replaced with Slack's unable-to-load-error image.
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.
- 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
-
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 ·
-
auto-triage-skip bug python web-client
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
slackapi/python-slack-sdk#1853 · 2 bình luận ·
Tất cả issue của slackapi/python-slack-sdk
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·