jupyter / declarativewidgets

[RETIRED] Jupyter Declarative Widget Extension
http://jupyter.org/declarativewidgets/docs.html
Other
120 stars 38 forks source link

Run all with channel set fails on loaded kernel #429

Open purdrew opened 8 years ago

purdrew commented 8 years ago

Ran into a failure while testing #423. The first Run All on a clean kernel will succeed, however after the first run, if you perform the following steps, an channel().set invoked before the client side initializes will not be replayed.

  1. Clear all outputs.
  2. Save notebook.
  3. Clear local storage from the browser (localStorage.clear())
  4. Refresh page.
  5. Run All

For testing I was using a Python notebook with the following cells but the issue appears on all supported kernels:

from declarativewidgets import init, channel

init()

channel().set("center_lat",30.4016717)
channel().set("center_long",-97.7166573)

channel("a").set("center_lat",1)
channel("a").set("center_long",2)
%%html
<urth-core-channel debug><urth-core-channel>
%%html
<urth-core-channel name="a" debug><urth-core-channel>
lbustelo commented 8 years ago

To add more context...

The reason this does not work is that the Channel instance has already been created in the kernel. Once a Channel is created, caching stop and so the channel.sets that take place before init are lost.

Since the Channel support on the kernel does not hold a storage of all channel data, it is not possible to do a sync. The kernel does not have a way to know that the user did all the steps described above, since they are all client side steps.

This would probably be one of those issues that would linger. I'm fine with leaving it open, but we may need to mark it with some tag.

@deedubbu Any idea for the name. I think something like wish_list, or good_to_have, or many a low_priority.