-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Dependent callbacks are not waited and executed in order #1519
Comments
Thanks @fraghag - I see it too and you're absolutely right that this is a bug. We'll have to poke around and see if this is a regression or simply a case that for some reason we've never handled correctly. |
I have the same problem with an app that I am developing. |
Hey everyone, I have started working on this issue. First of all, can someone confirm by looking at the following screen recording if I am reproducing the issue correctly. |
Bringing the discussion from slack in here. Following is the graph created for the chained callbacks app, where (CoV = CountriesValue, CiV= CitiesValue, CiO = CitiesOptions, DiC = DisplayChildren, cb = callback ). I have left out CountriesOptions (CoO) because that is not relevant here. Following are the steps performed, when
|
@alexcjohnson commented the following Ah OK, I see what you’re saying Faizan. I think your interpretation is correct, but yeah we may need to specifically handle several cases differently:
|
The fix that I have right now is the second one, i.e. I traverse the I don't think the first one is the cause of the issue here, if I am understanding it correctly. The issue will only occur if it's the second case. i.e. a callback is called twice, and one of them returns a stale value because it's called too soon. |
In summary the two options that @wbrgss mentioned seem to be the solutions here.
|
same problem |
is there any update on this? |
cc @alexcjohnson. |
Bumping again, I’m encountering this bug so very interested in getting a fix |
Hi @groegercesg, this is in the queue, the fix has been finalized, just needs some final testing and rebasing before it can be merged. |
Hi @eff-kay! Any news on this bug fix? |
@fraghag sorry we got busy with the DE5 release. Now that the release is done, I can schedule some time to get this through. Ideally in the next few weeks. |
Describe your context
I have a problem with chained callbacks where the last callback is called twice from one UI change. In the documentation I found this
https://dash.plotly.com/basic-callbacks
where it states under “Dash App With Chained Callbacks” that:
But when changing between America and Canada in the example on this page I can see that it first updates the text with the country and then the city. So when changing from America to Canada I can see “New York City is a city in Canada” very briefly which according to the documentation should not happen. I also ran this example locally with debugging and verified that the callback updating the text is run twice whenever I change the country.
Describe the bug
Callback A and callback B has resource A as a dependency, callback B is also dependent on the output of callback A.
When changing resource A, then callback A can be run before callback B is finished, and then runs again when callback A finishes since callback A updates another of callback B's input.
Expected behavior
When chaining callbacks, callback B should wait for callback A to finish, if callback B is dependent on the output of callback A.
The text was updated successfully, but these errors were encountered: