Skip to content

Commit e1cc4fe

Browse files
authored
Merge pull request #3282 from apmorton/am/fix-long-callback-cancellation
Fix incorrect cancellation of pattern matched long callbacks
2 parents 38f26fb + e33e0ac commit e1cc4fe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
99
- [#3280](https://github.com/plotly/dash/pull/3280) Remove flask typing import not available in earlier versions.
1010
- [#3284](https://github.com/plotly/dash/pull/3284) Fix component as props having the same key when used in the same container.
1111
- [#3287](https://github.com/plotly/dash/pull/3287) Fix typing component generation & explicitize_args.
12+
- [#3282](https://github.com/plotly/dash/pull/3282) Fix incorrect cancellation of pattern matched long callbacks.
1213

1314
## [3.0.3] - 2025-04-14
1415

dash/dash-renderer/src/actions/callbacks.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ function handleServerside(
418418
background: BackgroundCallbackInfo | undefined,
419419
additionalArgs: [string, string, boolean?][] | undefined,
420420
getState: any,
421-
output: string,
422421
running: any
423422
): Promise<CallbackResponse> {
424423
if (hooks.request_pre) {
@@ -572,7 +571,7 @@ function handleServerside(
572571
cacheKey: data.cacheKey as string,
573572
cancelInputs: data.cancel,
574573
progressDefault: data.progressDefault,
575-
output
574+
output: JSON.stringify(payload.outputs)
576575
};
577576
dispatch(addCallbackJob(jobInfo));
578577
job = data.job;
@@ -791,9 +790,10 @@ export function executeCallback(
791790
let lastError: any;
792791

793792
const additionalArgs: [string, string, boolean?][] = [];
793+
const jsonOutput = JSON.stringify(payload.outputs);
794794
values(getState().callbackJobs).forEach(
795795
(job: CallbackJobPayload) => {
796-
if (cb.callback.output === job.output) {
796+
if (jsonOutput === job.output) {
797797
// Terminate the old jobs that are not completed
798798
// set as outdated for the callback promise to
799799
// resolve and remove after.
@@ -830,7 +830,6 @@ export function executeCallback(
830830
background,
831831
additionalArgs.length ? additionalArgs : undefined,
832832
getState,
833-
cb.callback.output,
834833
cb.callback.running
835834
);
836835

0 commit comments

Comments
 (0)