diff --git a/src/kernels/jupyter/connection/serverUriStorage.ts b/src/kernels/jupyter/connection/serverUriStorage.ts index 7ba24a2b0c3..97604e6f20c 100644 --- a/src/kernels/jupyter/connection/serverUriStorage.ts +++ b/src/kernels/jupyter/connection/serverUriStorage.ts @@ -12,12 +12,7 @@ import { generateIdFromRemoteProvider, getOwnerExtensionOfProviderHandle } from '../jupyterUtils'; -import { - IJupyterServerUriEntry, - IJupyterServerUriStorage, - IJupyterUriProviderRegistration, - JupyterServerProviderHandle -} from '../types'; +import { IJupyterServerUriEntry, IJupyterServerUriStorage, JupyterServerProviderHandle } from '../types'; import { IFileSystem } from '../../../platform/common/platform/types'; import * as path from '../../../platform/vscode-path/resources'; import { noop } from '../../../platform/common/utils/misc'; @@ -65,8 +60,6 @@ export class JupyterServerUriStorage extends Disposables implements IJupyterServ constructor( @inject(IEncryptedStorage) encryptedStorage: IEncryptedStorage, @inject(IMemento) @named(GLOBAL_MEMENTO) globalMemento: Memento, - @inject(IJupyterUriProviderRegistration) - private readonly jupyterPickerRegistration: IJupyterUriProviderRegistration, @inject(IFileSystem) fs: IFileSystem, @inject(IExtensionContext) @@ -80,7 +73,7 @@ export class JupyterServerUriStorage extends Disposables implements IJupyterServ // eslint-disable-next-line @typescript-eslint/no-use-before-define this.oldStorage = new OldStorage(encryptedStorage, globalMemento); // eslint-disable-next-line @typescript-eslint/no-use-before-define - this.newStorage = new NewStorage(jupyterPickerRegistration, fs, storageFile, this.oldStorage); + this.newStorage = new NewStorage(fs, storageFile, this.oldStorage); this.disposables.push(this._onDidAddUri); this.disposables.push(this._onDidChangeUri); this.disposables.push(this._onDidRemoveUris); @@ -95,33 +88,26 @@ export class JupyterServerUriStorage extends Disposables implements IJupyterServ this.newStorage.onDidChange((e) => this._onDidChangeUri.fire(e), this, this.disposables); this.newStorage.onDidRemove((e) => this._onDidRemoveUris.fire(e), this, this.disposables); } - public async getAll(skipValidation?: boolean): Promise { + public async getAll(): Promise { this.hookupStorageEvents(); await this.newStorage.migrateMRU(); - return this.newStorage.getAll(!skipValidation); + return this.newStorage.getAll(); } public async clear(): Promise { this.hookupStorageEvents(); await this.newStorage.migrateMRU(); await Promise.all([this.oldStorage.clear(), this.newStorage.clear()]); } - public async add( - jupyterHandle: JupyterServerProviderHandle, - options?: { time: number; displayName: string } - ): Promise { + public async add(jupyterHandle: JupyterServerProviderHandle, options?: { time: number }): Promise { this.hookupStorageEvents(); await this.newStorage.migrateMRU(); traceInfoIfCI(`setUri: ${jupyterHandle.id}.${jupyterHandle.handle}`); const entry: IJupyterServerUriEntry = { time: options?.time ?? Date.now(), - displayName: options?.displayName, + displayName: '', provider: jupyterHandle }; - if (!options) { - const server = await this.jupyterPickerRegistration.getJupyterServerUri(jupyterHandle, true); - entry.displayName = server.displayName; - } await this.newStorage.add(entry); } public async update(server: JupyterServerProviderHandle) { @@ -217,8 +203,6 @@ class NewStorage { private migration: Promise | undefined; private updatePromise = Promise.resolve(); constructor( - @inject(IJupyterUriProviderRegistration) - private readonly jupyterPickerRegistration: IJupyterUriProviderRegistration, private readonly fs: IFileSystem, private readonly storageFile: Uri, private readonly oldStorage: OldStorage @@ -305,7 +289,7 @@ class NewStorage { .catch(noop)); } public async update(server: JupyterServerProviderHandle) { - const uriList = await this.getAllImpl(false); + const uriList = await this.getAllImpl(); const existingEntry = uriList.find( (entry) => entry.provider.id === server.id && entry.provider.handle === server.handle @@ -323,7 +307,7 @@ class NewStorage { public async remove(server: JupyterServerProviderHandle) { await (this.updatePromise = this.updatePromise .then(async () => { - const all = await this.getAllImpl(false); + const all = await this.getAllImpl(); if (all.length === 0) { return; } @@ -350,17 +334,17 @@ class NewStorage { }) .catch(noop)); } - public async getAll(validate = true): Promise { - return this.getAllImpl(validate).then((items) => items.sort((a, b) => b.time - a.time)); + public async getAll(): Promise { + return this.getAllImpl().then((items) => items.sort((a, b) => b.time - a.time)); } public async clear(): Promise { - const all = await this.getAllImpl(false); + const all = await this.getAllImpl(); await this.fs.delete(this.storageFile); if (all.length) { this._onDidRemoveUris.fire(all); } } - private async getAllImpl(validate = true): Promise { + private async getAllImpl(): Promise { const data = await this.getAllRaw(); const entries: IJupyterServerUriEntry[] = []; @@ -372,16 +356,7 @@ class NewStorage { displayName: item.displayName || uri, provider: item.serverHandle }; - if (!validate) { - entries.push(server); - return; - } - try { - await this.jupyterPickerRegistration.getJupyterServerUri(item.serverHandle, true); - entries.push(server); - } catch { - // - } + entries.push(server); }) ); return entries; diff --git a/src/kernels/jupyter/connection/serverUriStorage.unit.test.ts b/src/kernels/jupyter/connection/serverUriStorage.unit.test.ts index 31cc83c3e8e..1a06e0c9182 100644 --- a/src/kernels/jupyter/connection/serverUriStorage.unit.test.ts +++ b/src/kernels/jupyter/connection/serverUriStorage.unit.test.ts @@ -55,7 +55,6 @@ suite('Server Uri Storage', async () => { serverUriStorage = new JupyterServerUriStorage( instance(encryptedStorage), instance(memento), - instance(jupyterPickerRegistration), instance(fs), instance(context), disposables @@ -219,35 +218,30 @@ suite('Server Uri Storage', async () => { .sort((a, b) => a.time - b.time) .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.provider) }; - }) - .sort((a, b) => (a.displayName || '').localeCompare(b.displayName || '')), + }), itemsInNewStorage .sort((a, b) => a.time - b.time) .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.serverHandle) }; }) .concat({ - displayName: 'NewDisplayName1', uri: generateIdFromRemoteProvider({ id: 'NewId1', handle: 'NewHandle1', extensionId: JVSC_EXTENSION_ID }) }) - .sort((a, b) => (a.displayName || '').localeCompare(b.displayName || '')) ); assert.equal(onDidRemoveEvent.count, 0, 'Event should not be fired'); assert.equal(onDidAddEvent.count, 1, 'Event should be fired once'); assert.equal(onDidChangeEvent.count, 1, 'Event should be fired once'); }); - test('Add new entry with time and display name', async () => { + test('Add new entry with time', async () => { generateDummyData(2, true); when(fs.exists(anything())).thenResolve(true); when(fs.exists(uriEquals(globalStorageUri))).thenResolve(true); @@ -263,12 +257,12 @@ suite('Server Uri Storage', async () => { await serverUriStorage.add( { handle: 'NewHandle1', id: 'NewId1', extensionId: JVSC_EXTENSION_ID }, - { time: 1234, displayName: 'Sample Name' } + { time: 1234 } ); const all = await serverUriStorage.getAll(); verify(fs.writeFile(anything(), anything())).once(); - assert.strictEqual(all.find((a) => a.displayName === 'Sample Name')?.time, 1234, 'Incorrect time'); + assert.strictEqual(all.find((a) => a.provider.handle === 'NewHandle1')?.time, 1234, 'Incorrect time'); }); test('Add three new entries', async () => { const itemsInNewStorage = generateDummyData(2, true); @@ -314,20 +308,17 @@ suite('Server Uri Storage', async () => { all .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.provider) }; }) - .sort((a, b) => (a.displayName || '').localeCompare(b.displayName || '')), + .sort((a, b) => a.uri.localeCompare(b.uri)), itemsInNewStorage .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.serverHandle) }; }) .concat({ - displayName: 'NewDisplayName1', uri: generateIdFromRemoteProvider({ id: 'NewId1', handle: 'NewHandle1', @@ -335,7 +326,6 @@ suite('Server Uri Storage', async () => { }) }) .concat({ - displayName: 'NewDisplayName2', uri: generateIdFromRemoteProvider({ id: 'NewId2', handle: 'NewHandle2', @@ -343,14 +333,13 @@ suite('Server Uri Storage', async () => { }) }) .concat({ - displayName: 'NewDisplayName3', uri: generateIdFromRemoteProvider({ id: 'NewId3', handle: 'NewHandle3', extensionId: JVSC_EXTENSION_ID }) }) - .sort((a, b) => a.displayName.localeCompare(b.displayName)) + .sort((a, b) => a.uri.localeCompare(b.uri)) ); assert.equal(onDidRemoveEvent.count, 0, 'Event should not be fired'); @@ -403,20 +392,17 @@ suite('Server Uri Storage', async () => { all .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.provider) }; }) - .sort((a, b) => (a.displayName || '').localeCompare(b.displayName || '')), + .sort((a, b) => a.uri.localeCompare(b.uri)), itemsInNewStorage .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.serverHandle) }; }) .concat({ - displayName: 'NewDisplayName1', uri: generateIdFromRemoteProvider({ id: 'NewId1', handle: 'NewHandle1', @@ -424,7 +410,6 @@ suite('Server Uri Storage', async () => { }) }) .concat({ - displayName: 'NewDisplayName2', uri: generateIdFromRemoteProvider({ id: 'NewId2', handle: 'NewHandle2', @@ -432,14 +417,13 @@ suite('Server Uri Storage', async () => { }) }) .concat({ - displayName: 'NewDisplayName3', uri: generateIdFromRemoteProvider({ id: 'NewId3', handle: 'NewHandle3', extensionId: JVSC_EXTENSION_ID }) }) - .sort((a, b) => a.displayName.localeCompare(b.displayName)) + .sort((a, b) => a.uri.localeCompare(b.uri)) ); assert.equal(onDidRemoveEvent.count, 0, 'Event should not be fired'); @@ -493,20 +477,17 @@ suite('Server Uri Storage', async () => { all .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.provider) }; }) - .sort((a, b) => (a.displayName || '').localeCompare(b.displayName || '')), + .sort((a, b) => a.uri.localeCompare(b.uri)), itemsInNewStorage .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.serverHandle) }; }) .concat({ - displayName: 'NewDisplayName1', uri: generateIdFromRemoteProvider({ id: 'NewId1', handle: 'NewHandle1', @@ -514,14 +495,13 @@ suite('Server Uri Storage', async () => { }) }) .concat({ - displayName: 'NewDisplayName3', uri: generateIdFromRemoteProvider({ id: 'NewId3', handle: 'NewHandle3', extensionId: JVSC_EXTENSION_ID }) }) - .sort((a, b) => a.displayName.localeCompare(b.displayName)) + .sort((a, b) => a.uri.localeCompare(b.uri)) ); assert.equal(onDidRemoveEvent.count, 1, 'Event should be fired once'); @@ -573,20 +553,17 @@ suite('Server Uri Storage', async () => { all .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.provider) }; }) - .sort((a, b) => (a.displayName || '').localeCompare(b.displayName || '')), + .sort((a, b) => a.uri.localeCompare(b.uri)), itemsInNewStorage .map((a) => { return { - displayName: a.displayName, uri: generateIdFromRemoteProvider(a.serverHandle) }; }) .concat({ - displayName: 'NewDisplayName1', uri: generateIdFromRemoteProvider({ id: 'NewId1', handle: 'NewHandle1', @@ -594,14 +571,13 @@ suite('Server Uri Storage', async () => { }) }) .concat({ - displayName: 'NewDisplayName3', uri: generateIdFromRemoteProvider({ id: 'NewId3', handle: 'NewHandle3', extensionId: JVSC_EXTENSION_ID }) }) - .sort((a, b) => a.displayName.localeCompare(b.displayName)) + .sort((a, b) => a.uri.localeCompare(b.uri)) ); assert.equal(onDidRemoveEvent.count, 1, 'Event should be fired once'); diff --git a/src/kernels/jupyter/finder/remoteKernelFinder.ts b/src/kernels/jupyter/finder/remoteKernelFinder.ts index af00e41b490..decb160bcb3 100644 --- a/src/kernels/jupyter/finder/remoteKernelFinder.ts +++ b/src/kernels/jupyter/finder/remoteKernelFinder.ts @@ -18,7 +18,7 @@ import { IOldJupyterSessionManagerFactory, IJupyterRemoteCachedKernelValidator, IRemoteKernelFinder, - IJupyterServerUriEntry + JupyterServerProviderHandle } from '../types'; import { sendKernelSpecTelemetry } from '../../raw/finder/helper'; import { traceError, traceWarning, traceInfoIfCI, traceVerbose } from '../../../platform/logging'; @@ -95,13 +95,13 @@ export class RemoteKernelFinder implements IRemoteKernelFinder, IDisposable { private readonly cachedRemoteKernelValidator: IJupyterRemoteCachedKernelValidator, kernelFinder: KernelFinder, private readonly kernelProvider: IKernelProvider, - readonly serverUri: IJupyterServerUriEntry, + readonly serverProviderHandle: JupyterServerProviderHandle, private readonly jupyterConnection: JupyterConnection, private readonly fs: IFileSystem, private readonly context: IExtensionContext ) { this.cacheFile = Uri.joinPath(context.globalStorageUri, RemoteKernelSpecCacheFileName); - this.cacheKey = generateIdFromRemoteProvider(serverUri.provider); + this.cacheKey = generateIdFromRemoteProvider(serverProviderHandle); // When we register, add a disposable to clean ourselves up from the main kernel finder list // Unlike the Local kernel finder universal remote kernel finders will be added on the fly this.disposables.push(kernelFinder.registerKernelFinder(this)); @@ -260,7 +260,7 @@ export class RemoteKernelFinder implements IRemoteKernelFinder, IDisposable { disposables.push(KernelProgressReporter.createProgressReporter(undefined, DataScience.connectingToJupyter)); } return this.jupyterConnection - .createConnectionInfo(this.serverUri.provider) + .createConnectionInfo(this.serverProviderHandle) .finally(() => disposeAllDisposables(disposables)); } diff --git a/src/kernels/jupyter/finder/remoteKernelFinder.unit.test.ts b/src/kernels/jupyter/finder/remoteKernelFinder.unit.test.ts index f1f8f4b7a40..dbfc269636e 100644 --- a/src/kernels/jupyter/finder/remoteKernelFinder.unit.test.ts +++ b/src/kernels/jupyter/finder/remoteKernelFinder.unit.test.ts @@ -158,7 +158,7 @@ suite(`Remote Kernel Finder`, () => { instance(cachedRemoteKernelValidator), kernelFinder, instance(kernelProvider), - serverEntry, + serverEntry.provider, instance(jupyterConnection), instance(fs), instance(context) diff --git a/src/kernels/jupyter/finder/remoteKernelFinderController.ts b/src/kernels/jupyter/finder/remoteKernelFinderController.ts index 8a138a08076..846822a4ae9 100644 --- a/src/kernels/jupyter/finder/remoteKernelFinderController.ts +++ b/src/kernels/jupyter/finder/remoteKernelFinderController.ts @@ -8,7 +8,9 @@ import { IOldJupyterSessionManagerFactory, IJupyterServerUriStorage, IJupyterRemoteCachedKernelValidator, - IJupyterServerUriEntry + IJupyterServerUriEntry, + IJupyterUriProviderRegistration, + JupyterServerProviderHandle } from '../types'; import { noop } from '../../../platform/common/utils/misc'; import { IApplicationEnvironment } from '../../../platform/common/application/types'; @@ -19,6 +21,7 @@ import { JupyterConnection } from '../connection/jupyterConnection'; import { IFileSystem } from '../../../platform/common/platform/types'; import { ContributedKernelFinderKind } from '../../internalTypes'; import { generateIdFromRemoteProvider } from '../jupyterUtils'; +import { swallowExceptions } from '../../../platform/common/utils/decorators'; @injectable() export class RemoteKernelFinderController implements IExtensionSyncActivationService { @@ -36,36 +39,44 @@ export class RemoteKernelFinderController implements IExtensionSyncActivationSer @inject(JupyterConnection) private readonly jupyterConnection: JupyterConnection, @inject(IDisposableRegistry) private readonly disposables: IDisposableRegistry, @inject(IFileSystem) private readonly fs: IFileSystem, - @inject(IExtensionContext) private readonly context: IExtensionContext + @inject(IExtensionContext) private readonly context: IExtensionContext, + @inject(IJupyterUriProviderRegistration) + private readonly jupyterPickerRegistration: IJupyterUriProviderRegistration ) {} activate() { // Check for when more URIs are added - this.serverUriStorage.onDidAdd(this.createRemoteKernelFinder, this, this.disposables); + this.serverUriStorage.onDidAdd((server) => this.validateAndCreateFinder(server), this, this.disposables); // Also check for when a URI is removed this.serverUriStorage.onDidRemove(this.urisRemoved, this, this.disposables); + // Add in the URIs that we already know about this.serverUriStorage .getAll() - .then((currentServers) => { - currentServers.forEach(this.createRemoteKernelFinder.bind(this)); + .then(async (currentServers) => { + await Promise.all(currentServers.map((server) => this.validateAndCreateFinder(server))); }) .catch(noop); } + @swallowExceptions('Failed to create a Remote Kernel Finder') + private async validateAndCreateFinder(serverUri: IJupyterServerUriEntry) { + const info = await this.jupyterPickerRegistration.getJupyterServerUri(serverUri.provider, true); + this.createRemoteKernelFinder(serverUri.provider, info.displayName); + } - createRemoteKernelFinder(serverUri: IJupyterServerUriEntry) { - const serverId = generateIdFromRemoteProvider(serverUri.provider); + createRemoteKernelFinder(serverProviderHandle: JupyterServerProviderHandle, displayName: string) { + const serverId = generateIdFromRemoteProvider(serverProviderHandle); if (!this.serverFinderMapping.has(serverId)) { const finder = new RemoteKernelFinder( `${ContributedKernelFinderKind.Remote}-${serverId}`, - serverUri.displayName || generateIdFromRemoteProvider(serverUri.provider), + displayName, this.jupyterSessionManagerFactory, this.env, this.cachedRemoteKernelValidator, this.kernelFinder, this.kernelProvider, - serverUri, + serverProviderHandle, this.jupyterConnection, this.fs, this.context diff --git a/src/kernels/jupyter/types.ts b/src/kernels/jupyter/types.ts index b0d7c3131c6..e2d82c831da 100644 --- a/src/kernels/jupyter/types.ts +++ b/src/kernels/jupyter/types.ts @@ -184,6 +184,7 @@ export interface IJupyterServerUriEntry { time: number; /** * An optional display name to show for this server as opposed to just the Uri + * @deprecated Used only for migration of display names into the User Provided Server list. Else other providers will have the Display Names. */ displayName?: string; } @@ -197,21 +198,10 @@ export interface IJupyterServerUriStorage { * Updates MRU list marking this server as the most recently used. */ update(serverProviderHandle: JupyterServerProviderHandle): Promise; - /** - * Gets the list of used servers. - * Note: When this method is called, it will validate the server information against - * the corresponding extension that contributed the server. - * As a result, this method is slow and will wait for all extensions to activate that have contributed servers. - * - * @param skipValidation If true, will not validate the server information before returning it. - */ - getAll(skipValidation?: boolean): Promise; + getAll(): Promise; remove(serverProviderHandle: JupyterServerProviderHandle): Promise; clear(): Promise; - add( - serverProviderHandle: JupyterServerProviderHandle, - options?: { time: number; displayName: string } - ): Promise; + add(serverProviderHandle: JupyterServerProviderHandle, options?: { time: number }): Promise; } export interface IBackupFile { @@ -298,5 +288,5 @@ export interface IJupyterRemoteCachedKernelValidator { export interface IRemoteKernelFinder extends IContributedKernelFinder { kind: ContributedKernelFinderKind.Remote; - serverUri: IJupyterServerUriEntry; + serverProviderHandle: JupyterServerProviderHandle; } diff --git a/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts b/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts index 10fb130590e..ec00f688d48 100644 --- a/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts +++ b/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts @@ -127,15 +127,13 @@ export class RemoteNotebookKernelSourceSelector implements IRemoteNotebookKernel await Promise.all( servers - .filter((s) => s.serverUri.provider.id === provider.id) + .filter((s) => s.serverProviderHandle.id === provider.id) .map(async (server) => { // remote server - const lastUsedTime = await ( - await this.serverUriStorage.getAll() - ).find( + const lastUsedTime = (await this.serverUriStorage.getAll()).find( (item) => generateIdFromRemoteProvider(item.provider) === - generateIdFromRemoteProvider(server.serverUri.provider) + generateIdFromRemoteProvider(server.serverProviderHandle) ); if (token.isCancellationRequested || !lastUsedTime) { return; @@ -143,7 +141,7 @@ export class RemoteNotebookKernelSourceSelector implements IRemoteNotebookKernel items.push({ type: KernelFinderEntityQuickPickType.KernelFinder, kernelFinderInfo: server, - idAndHandle: server.serverUri.provider, + idAndHandle: server.serverProviderHandle, label: server.displayName, detail: DataScience.jupyterSelectURIMRUDetail(new Date(lastUsedTime.time)), buttons: provider.removeHandle @@ -288,8 +286,8 @@ export class RemoteNotebookKernelSourceSelector implements IRemoteNotebookKernel const found = this.kernelFinder.registered.find( (f) => f.kind === 'remote' && - (f as IRemoteKernelFinder).serverUri.provider.id === serverId.id && - (f as IRemoteKernelFinder).serverUri.provider.handle === serverId.handle + (f as IRemoteKernelFinder).serverProviderHandle.id === serverId.id && + (f as IRemoteKernelFinder).serverProviderHandle.handle === serverId.handle ); if (found) { return resolve(found); @@ -299,8 +297,8 @@ export class RemoteNotebookKernelSourceSelector implements IRemoteNotebookKernel const found = e.added.find( (f) => f.kind === 'remote' && - (f as IRemoteKernelFinder).serverUri.provider.id === serverId.id && - (f as IRemoteKernelFinder).serverUri.provider.handle === serverId.handle + (f as IRemoteKernelFinder).serverProviderHandle.id === serverId.id && + (f as IRemoteKernelFinder).serverProviderHandle.handle === serverId.handle ); if (found) { return resolve(found); diff --git a/src/standalone/userJupyterServer/userServerUriProvider.unit.test.ts b/src/standalone/userJupyterServer/userServerUriProvider.unit.test.ts index 5f6eadd8d72..457129f8276 100644 --- a/src/standalone/userJupyterServer/userServerUriProvider.unit.test.ts +++ b/src/standalone/userJupyterServer/userServerUriProvider.unit.test.ts @@ -118,7 +118,7 @@ suite('User Uri Provider', () => { multiStepFactory = mock(); commands = mock(); requestCreator = mock(); - when(serverUriStorage.getAll(true)).thenResolve([]); + when(serverUriStorage.getAll()).thenResolve([]); when(applicationShell.createInputBox()).thenReturn(inputBox); when(jupyterConnection.validateRemoteUri(anything())).thenResolve(); when(globalMemento.get(UserJupyterServerUriListKey)).thenReturn([]); @@ -258,7 +258,7 @@ suite('User Uri Provider', () => { when( encryptedStorage.retrieve(Settings.JupyterServerRemoteLaunchService, UserJupyterServerUriListKeyV2) ).thenResolve(JSON.stringify(dataInUserJupyterServerStorage)); - when(serverUriStorage.getAll(true)).thenResolve([ + when(serverUriStorage.getAll()).thenResolve([ { provider: { extensionId: JVSC_EXTENSION_ID, diff --git a/src/standalone/userJupyterServer/userServerUrlProvider.ts b/src/standalone/userJupyterServer/userServerUrlProvider.ts index b519fd71c42..9ede60dc0b3 100644 --- a/src/standalone/userJupyterServer/userServerUrlProvider.ts +++ b/src/standalone/userJupyterServer/userServerUrlProvider.ts @@ -203,7 +203,7 @@ export class UserJupyterServerUrlProvider await this.addNewServer(server); await this.serverUriStorage.add( { id: this.id, handle: server.handle, extensionId: JVSC_EXTENSION_ID }, - { time: server.time, displayName: server.serverInfo.displayName } + { time: server.time } ); } catch { // @@ -704,7 +704,7 @@ export class NewStorage { // No migration necessary return; } - const allServers = await uriStorage.getAll(true).catch((ex) => { + const allServers = await uriStorage.getAll().catch((ex) => { traceError('Failed to get all servers from storage', ex); return []; });