ipywidgets
ipywidgets copied to clipboard
Make sure that all session contexts has unique IDs even if they don't have a kernel
trafficstars
Fixes https://github.com/jupyter-widgets/ipywidgets/issues/3970 by making sure that we can always retrieve the widget manager owner from a session context, even if the session context does not have kernel attached. This gets rid of the exception when retrieving the kernel ID from session context with no kernel:
plugin.ts:153 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'kernel')
at getWidgetManagerOwner (plugin.ts:153:34)
at async registerWidgetHandler (plugin.ts:175:25)
at async plugin.ts:424:7
ipywidgets works properly after attaching ipykernel to a notebook that initially has no kernel after applying this fix.