From c52b2306e980f4e4ac26d14992a0cfde9d9189f2 Mon Sep 17 00:00:00 2001 From: Mario Buikhuizen Date: Mon, 27 Nov 2023 15:53:24 +0100 Subject: [PATCH] fix: restoring widgets from saved state is broken since v8 In 9d999d7b waiting for sessionContext.ready was removed, this caused _loadNotebook() not to work, because it was called before the widget metadata was available. This commit restores waiting for sessionContext.ready. This has to be before _loadFromKernel(), otherwise this.kernel is not present, causing an exeption, skipping _loadNotebook(). Fixes: https://github.com/jupyterlab/jupyterlab/issues/15361 --- python/jupyterlab_widgets/src/manager.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/python/jupyterlab_widgets/src/manager.ts b/python/jupyterlab_widgets/src/manager.ts index 9ee14d76fc..fec2cb3e4e 100644 --- a/python/jupyterlab_widgets/src/manager.ts +++ b/python/jupyterlab_widgets/src/manager.ts @@ -496,6 +496,7 @@ export class WidgetManager extends LabWidgetManager { { loadKernel, loadNotebook } = { loadKernel: true, loadNotebook: true } ): Promise { try { + await this.context.sessionContext.ready; if (loadKernel) { try { this._kernelRestoreInProgress = true;