Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.8k
Open
Labels
Description
When running a single test which renames a file, e.g. by creating and renaming it like:
await page.notebook.createNew(fileName);I consistently see a timeout with:
Error: page.evaluate: Target closed at src/contents.ts:294 292 | // Rename through REST API does not propagate to opened widgets 293 | // => Use galata in-page if page is available> 294 | return await this.page.evaluate( | ^ 295 | async ({ pluginId, oldName, newName }) => { 296 | const docManager = (await window.galata.getPlugin( 297 | pluginId at ContentsHelper.renameFile (jupyterlab/galata/src/contents.ts:294:30) at NotebookHelper.createNew (jupyterlab/galata/src/helpers/notebook.ts:1207:25)This appears related to the in-page galata helper having_app as undefined. Strangely_app is set in getter:
jupyterlab/galata/extension/src/global.ts
Lines 742 to 747 in89154f5
| getapp():JupyterFrontEnd{ | |
| if(!this._app){ | |
| this._app=window.jupyterapp; | |
| } | |
| returnthis._app; | |
| } |
but this getter may not have been called sine the test was initialized;ContentsHelper.renameFile indeed callswindow.galata.getPlugin which accesses_app and not.app.
Invoking the getter, e.g. "fixes" the problem:
window.galata = new GalataInpage();+ window.galata.app;Now, I wonder if we could just assign app in the extension:
jupyterlab/galata/extension/src/index.ts
Lines 24 to 39 in89154f5
| window.galata=newGalataInpage(); | |
| /** | |
| * Galata in-page object | |
| *@deprecated | |
| */ | |
| window.galataip=window.galata; | |
| constgalataPlugin:JupyterFrontEndPlugin<IGalataHelpers>={ | |
| id:PLUGIN_ID_GALATA_HELPERS, | |
| autoStart:true, | |
| activate:(app:JupyterFrontEnd):IGalataHelpers=>{ | |
| returnObject.freeze({ | |
| notifications:Notification.manager, | |
| dialogs:Dialog.tracker | |
| }); | |
| } |