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

Deserialize state before setting it, as is done elsewhere set_state is used #3549

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

jasongrout
Copy link
Member

@jasongrout jasongrout commented Aug 18, 2022

This is causing at least one problem in the ipyleaflet 8.0 upgrade tests, as seen in jupyter-widgets/ipyleaflet#968

This code is similar to code from another place in this file that has similar logic:

// If the model has already been created, set its state and then
// return it.
if (this.has_model(model_id)) {
return this.get_model(model_id)!.then((model) => {
// deserialize state
return (model.constructor as typeof WidgetModel)
._deserialize_state(modelState || {}, this)
.then((attributes) => {
model.set_state(attributes); // case 2
return model;
});
});
}

…s used.

This is causing at least one problem in the ipyleaflet 8.0 upgrade tests, as seen in jupyter-widgets/ipyleaflet#968
@jasongrout jasongrout added this to the 8.0 milestone Aug 18, 2022
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch jasongrout/ipywidgets/deserialize

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks a lot for investigating this! This looks good to me

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

Successfully merging this pull request may close these issues.

None yet

2 participants