Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Protect against a potential timing error in the model creation logic #322

Merged
merged 1 commit into from
Apr 25, 2016

Conversation

lbustelo
Copy link
Collaborator

The problem was due to the following:

  • Call to widget_manager.new_widget(...).then(function(model){...})
  • The call to new_widget is what opens the comm with jupyter.widgets
  • There is no handler for the target name in the kernel (R, Scala) yet, so it closes the comm
  • The comm close is handled on the browser side before the WidgetModel is create and passed to the callback above
  • If in my callback I want to respond to model.once("comm:close") it is too late

This PR is protecting in the callback and checking if the model's comm is still registered in the CommManager. This give me a chance to kick off the retry logic directly.

@lbustelo
Copy link
Collaborator Author

/cc @SylvainCorlay

@poplav
Copy link
Contributor

poplav commented Apr 25, 2016

Tested this and it looks to have resolved a main issue that was hindering system tests, #206. A timing issue related to channel initialization messages.

LGTM

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.

2 participants