`slack_file` image blocks appended with `chat.appendStream` render as missing images inline
还没有人认领这个 Issue。
评估
调研方向
首先,使用列出的版本,通过 files_upload_v2、files_info、chat_startStream、chat_appendStream 和 chat_stopStream 重现该序列。将 SDK 请求 payload 与 Slack 的流式 API 行为进行比较,并确定失败发生在 SDK 中还是服务器端。若确定需要进行 SDK 端更改,则记录原因并添加一个有针对性的回归测试,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 4k
- 派生
- 857
- 平均合并
- 22 小时 21 分钟
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slackapi/python-slack-sdk 的其他 Issue
-
Use logger.isEnabledFor(logging.DEBUG) instead of logger.level <= logging.DEBUG for debug guards 未关闭auto-triage-skip bug
难度 4/5 3-5 天 新手友好度 55/100
slackapi/python-slack-sdk#1957 ·
-
auto-triage-skip discussion
难度 5/5 一周以上 新手友好度 35/100
slackapi/python-slack-sdk#1940 · 2 条评论 ·
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel 未关闭auto-triage-skip enhancement
难度 4/5 3-5 天 新手友好度 48/100
slackapi/python-slack-sdk#1923 · 2 条评论 ·
-
auto-triage-skip bug socket-mode
难度 3/5 1-2 天 新手友好度 72/100
slackapi/python-slack-sdk#1922 · 2 条评论 ·
-
auto-triage-skip bug python web-client
难度 3/5 1-2 天 新手友好度 52/100
slackapi/python-slack-sdk#1853 · 2 条评论 ·
查看 slackapi/python-slack-sdk 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·