Skip to content

Commit 7dd07d5

Browse files
authored
Merge pull request #2625 from plotly/fix/#2624
Fix background callbacks missing cancel error.
2 parents 6d246ef + 86c6a07 commit 7dd07d5

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

55

6+
## [2.12.1] - 2023-08-16
7+
8+
## Fixed
9+
10+
- [#2625](https://github.com/plotly/dash/pull/2625) Fix background callbacks without cancel arguments failing setup, fix [#2624](https://github.com/plotly/dash/issues/2624)
11+
612
## [2.12.0] - 2023-08-14
713

814
## Fixed

Diff for: dash/dash.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,8 @@ def _setup_server(self):
13211321
long = callback.get("long")
13221322
if not long:
13231323
continue
1324-
cancel = long.pop("cancel_inputs")
1325-
if cancel:
1324+
if "cancel_inputs" in long:
1325+
cancel = long.pop("cancel_inputs")
13261326
for c in cancel:
13271327
cancels[c] = long.get("manager")
13281328

Diff for: dash/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.12.0"
1+
__version__ = "2.12.1"

Diff for: tests/integration/long_callback/app_page_cancel.py

+12
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
html.Button("cancel1", id="cancel1"),
3535
html.Div("idle", id="progress1"),
3636
html.Div("initial", id="output1"),
37+
html.Div("no-cancel-btn", id="no-cancel-btn"),
38+
html.Div("no-cancel", id="no-cancel-output"),
3739
]
3840
),
3941
)
@@ -51,6 +53,16 @@
5153
)
5254

5355

56+
@app.callback(
57+
Output("no-cancel-output", "children"),
58+
Input("no-cancel-btn", "n_clicks"),
59+
background=True,
60+
prevent_initial_call=True,
61+
)
62+
def on_click_no_cancel(_):
63+
return "Not Canceled"
64+
65+
5466
@app.callback(
5567
Output("output1", "children"),
5668
Input("start1", "n_clicks"),

0 commit comments

Comments
 (0)