Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dash/_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def add_context(*args, **kwargs):
job = callback_manager.call_job_fn(
cache_key,
job_fn,
args,
func_args if func_args else func_kwargs,
AttributeDict(
args_grouping=callback_ctx.args_grouping,
using_args_grouping=callback_ctx.using_args_grouping,
Expand Down
31 changes: 31 additions & 0 deletions tests/integration/long_callback/app_unordered.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from dash import Dash, Input, Output, dcc, State, html, callback

from tests.integration.long_callback.utils import get_long_callback_manager

long_callback_manager = get_long_callback_manager()
handle = long_callback_manager.handle

app = Dash(__name__, long_callback_manager=long_callback_manager)

app.layout = html.Div(
[
html.Div(id="output"),
html.Button("click", id="click"),
dcc.Store(data="stored", id="stored"),
]
)


@callback(
Output("output", "children"),
State("stored", "data"),
Input("click", "n_clicks"),
background=True,
prevent_initial_call=True,
)
def update_output(stored, n_clicks):
return stored


if __name__ == "__main__":
app.run_server(debug=True)
8 changes: 8 additions & 0 deletions tests/integration/long_callback/test_basic_long_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,3 +523,11 @@ def test_lcbc012_long_callback_ctx(dash_duo, manager):
output = json.loads(dash_duo.find_element("#result").text)

assert output["triggered"]["index"] == 0


def test_lcbc013_unordered_state_input(dash_duo, manager):
with setup_long_callback_app(manager, "app_unordered") as app:
dash_duo.start_server(app)
dash_duo.find_element("#click").click()

dash_duo.wait_for_text_to_equal("#output", "stored")