[BUG] `set_props` streaming

未關閉
#4,127 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@BSd3v 已經在處理了。

開始於 2026年11月6日。

  • #4129 來自 @BSd3v —— 未關閉

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
flask, python, react

研究方向

Start by reproducing the issue with the example app in the report and trace how streaming callbacks deliver set_props updates to the client. Check the related open pull request #4129 for the current investigation. Done means the first set_props update reaches the client before the callback yields, with regression coverage for the reported sequence.

由索引模型根據 Issue 內容生成。

描述

bug P3 size: 1

In Dash 4.5.0:

A streaming callback does not send set_props to the client until the next yield.

Below is an example app:

from dash import LocalSharedStorage, Dash, html, dcc, Input, Output, callback, set_props, no_update
import asyncio

app = Dash(__name__,
           shared_storage=LocalSharedStorage())

app.layout = html.Div([
    html.Button(id='input', type='button', children='Click Me'),
    html.Div(id='output')
])

@callback(
    Output('output', 'id'),
    Input('input', 'n_clicks'),
    prevent_initial_call=True
)
async def update_output(value):
    set_props('output', {'children': html.Div(id='output2', children='Loading...')})
    # yield no_update
    await asyncio.sleep(1)
    set_props('output2', {'children': f'You entered: {value}'})
    yield no_update

if __name__ == '__main__':
    app.run(debug=True)
主要語言
Python
星號
24.5k
分支
2.3k
平均合併
3 天 7 小時
30 天內合併 PR
30

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

plotly/dash 的其他 Issue

查看 plotly/dash 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。