Skip to content

Commit

Permalink
Deserialize state before setting it, as is done elsewhere set_state i…
Browse files Browse the repository at this point in the history
…s used.

This is causing at least one problem in the ipyleaflet 8.0 upgrade tests, as seen in jupyter-widgets/ipyleaflet#968
  • Loading branch information
jasongrout committed Aug 18, 2022
1 parent 3e6e99d commit bf68169
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/base-manager/src/manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ export abstract class ManagerBase implements IWidgetManager {
} else {
// model already exists here
const model = await this.get_model(widget_id);
model!.set_state(state.state);
const deserializedState = await (
model.constructor as typeof WidgetModel
)._deserialize_state(state.state, this);
model!.set_state(deserializedState);
}
} catch (error) {
// Failed to create a widget model, we continue creating other models so that
Expand Down

0 comments on commit bf68169

Please sign in to comment.