Skip to content
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] Callback with canceled update intermittently prevents later callback #1053

Closed
alexcjohnson opened this issue Dec 19, 2019 · 0 comments
Closed
Milestone

Comments

@alexcjohnson
Copy link
Collaborator

If I make a callback chain where a final output depends on an input via multiple paths, a PreventUpdate on one of those paths can intermittently prevent the final callback from ever firing.

import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate

app = dash.Dash(__name__)
app.layout = html.Div([
    dcc.Input(id='a', value="x"),
    html.Div('b', id='b'),
    html.Div('c', id='c'),
    html.Div(id='out')
])

@app.callback(
    Output("out", "children"),
    [Input("a", "value"), Input("b", "children"), Input("c", "children")]
)
def set_out(a, b, c):
    print("out")
    return "{}/{}/{}".format(a, b, c)

@app.callback(Output("b", "children"), [Input("a", "value")])
def set_b(a):
    print("b")
    raise PreventUpdate

@app.callback(Output("c", "children"), [Input("a", "value")])
def set_c(a):
    print("c")
    return a

if __name__ == "__main__":
    app.run_server(debug=True)

Both on initial load and later as you type in the input box, sometimes you'll see the last line correctly concatenating the three lines before it, sometimes it lags behind. I don't notice a pattern, this happens anywhere from about a quarter to three quarters of the time.

I'll try to sort this out along with wildcards #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants