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

Can't update children trait after widget is displayed. #1060

Closed
bollwyvl opened this issue Dec 19, 2022 · 5 comments · Fixed by #1061
Closed

Can't update children trait after widget is displayed. #1060

bollwyvl opened this issue Dec 19, 2022 · 5 comments · Fixed by #1061

Comments

@bollwyvl
Copy link
Contributor

Akin to #1059, here's another fun gist with binder that demonstrates some issues observed while try to upgrade to 6.19.x.

Basically:

  • Creating a HBox with children displays them immediately
  • Creating an HBox and then setting children doesn't show anything at all
    • well, the .widget-hbox gets created, but its empty, and never updates

Again, I'll do a bit more debugging.

Screenshot from 2022-12-19 17-01-17

@bollwyvl
Copy link
Contributor Author

I've added kernelspy to the gist.

6.17 6.19
image image

@bollwyvl
Copy link
Contributor Author

Here's the expanded comm_msg missing in in 6.19: sure enough, it's the one that sets the children.

image

@bollwyvl
Copy link
Contributor Author

In notify_change, ipywidgets checks if the comm.kernel is None, this appears to always be the case, even for previously-established comms.

https://github.com/jupyter-widgets/ipywidgets/blob/f89c5d983d534fe3bbf8440f085e228ee89d681c/python/ipywidgets/ipywidgets/widgets/widget.py#L689

@maartenbreddels
Copy link
Contributor

Ok, this was the bug I was hunting, didn't expect this. Thanks again 🙏

@bollwyvl
Copy link
Contributor Author

bollwyvl commented Dec 20, 2022

This was a good exercise: i guess my lesson learned was that going right to the message trace its where it's at for these things.

kernelspy is fine, but not very fine-grained, and running the full lab UI requires so many downstreams that it might be limiting.

Perhaps something lower level that allowed for capturing full traces as JSON lines would be a good feature... building it into the kernel itself would be... something, but probably makes more sense to do it out-of-band so that you can run it against other kernels, akin to jupyter_kernel_test, but maybe something that worked with an existing forensic tool, e.g. kernelshark for wireshark.

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

Successfully merging a pull request may close this issue.

2 participants