Skip to content

[BUG] set_props streaming #4127

Open

Description

@BSd3v

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)

Activity

  1. BSd3v commented on Nov 6, 2026

    @BSd3v
    ContributorAuthor

    Here is a helper function that can create passive responses for the time-being:

    def make_no_update_response(ctx):
        # Return a no_update payload that matches the callback output shape.
        outputs_list = getattr(ctx, "outputs_list", None)
        if isinstance(outputs_list, list) and outputs_list:
            return [no_update for _ in outputs_list]
    
        outputs_grouping = getattr(ctx, "outputs_grouping", None)
        if isinstance(outputs_grouping, list):
            return [no_update for _ in outputs_grouping]
        if isinstance(outputs_grouping, tuple):
            return tuple(no_update for _ in outputs_grouping)
        if isinstance(outputs_grouping, dict):
            return {k: no_update for k in outputs_grouping}
    
        body = getattr(ctx, "body", None)
        if isinstance(body, dict):
            outputs = body.get("outputs")
            if isinstance(outputs, list):
                return [no_update for _ in outputs]
    
        return no_update
    
  2. changed the title [-][BUG] `set_props` streaming in Flask[/-] [+][BUG] `set_props` streaming[/+] on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions