Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

204 NO CONTENT regression fix #170

Merged
merged 6 commits into from
May 10, 2019
Merged

204 NO CONTENT regression fix #170

merged 6 commits into from
May 10, 2019

Conversation

Marc-Andre-Rivet
Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented May 9, 2019

Regression between Dash 0.41 and 0.42

Reproducible with Byron's code below:

import dash
import dash_html_components as html
import dash_core_components as dcc
from multiprocessing import Value
from dash.dependencies import Input, Output
from dash import callback_context, no_update
from dash.exceptions import PreventUpdate
from multiprocessing import Value

initial_input = 'initial input'
initial_output = 'initial output'


app = dash.Dash(__name__)
# app.config['suppress_callback_exceptions'] = True
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True

app.layout = html.Div([
    dcc.Input(id='input', value=initial_input),
    html.Div(initial_output, id='output1'),
    html.Div(initial_output, id='output2'),
])

callback1_count = Value('i', 0)
callback2_count = Value('i', 0)


@app.callback(Output('output1', 'children'), [Input('input', 'value')])
def callback1(value):
    callback1_count.value += 1
    if callback1_count.value > 2:
        return no_update
    raise PreventUpdate("testing callback does not update")


@app.callback(Output('output2', 'children'), [Input('output1', 'children')])
def callback2(value):
    callback2_count.value += 1
    return value

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

Introduced in: https://github.com/plotly/dash-renderer/pull/152/files#diff-4e3037116dbc2bc69a473b7ace3d02abR678 and https://github.com/plotly/dash-renderer/pull/162/files#diff-4e3037116dbc2bc69a473b7ace3d02abR682

Marc-André Rivet added 2 commits May 9, 2019 16:43
@Marc-Andre-Rivet Marc-Andre-Rivet marked this pull request as ready for review May 9, 2019 20:54
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Non-blocking, but it would be a bit cleaner as

if (res.status === STATUS.PREVENT_UPDATE) {
    return;
}
throw res;

But I do think this warrants a test case.

@byronz
Copy link
Contributor

byronz commented May 10, 2019

But I do think this warrants a test case.

the above sample app from one of integration would be able to catch the issue
but failed to notify as I believe there is a bug in old implementation of check clear console log in selenium. consolidate the IntegrationTest for both dash and dash-renderer with desired_capabilities disclosed it. yes but we would need more customized case later

@alexcjohnson
Copy link
Collaborator

consolidate the IntegrationTest for both dash and dash-renderer with desired_capabilities disclosed it.

Ok, if you have a test to 🔒 this elsewhere, we can merge this PR without one. Though it looks like there’s a test already that’s sensitive to this and needs fixing?

@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented May 10, 2019

Not sure what's going on here but the error was already present when the renderer was bumped to 0.23: https://circleci.com/gh/plotly/dash-renderer/2189?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Maybe dash had been updated since the last renderer change and some interaction changed / caused the issue.

@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented May 10, 2019

Ah! So the failure comes from this change in DCC: https://github.com/plotly/dash-core-components/blame/master/src/components/Input.react.js#L103

As previously discussed, some attention to the builds is still required when bumping versions as some combinations of packages don't get automatically tested yet. In this case dcc was last updated after renderer and the diff was only caught at release.

Updating the test.

@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented May 10, 2019

The percy diffs are caused by the previous failure in master erasing the baseline screenshots for test_callbacks_generating_children. Approving them.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 thanks for propagating my default input type change to the tests here

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit 4744414 into master May 10, 2019
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 204-regression-fix branch May 10, 2019 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants