From 638de7066bbef3bdfc31f883200802be755cd5d6 Mon Sep 17 00:00:00 2001 From: sharon Date: Wed, 16 Oct 2024 14:17:11 -0400 Subject: [PATCH] Rename indexed dbs with `positron` prefix (#5035) - Addresses: #4864 - updates the prefixes for web IndexedDB databases and stores to use `positron` instead of `vscode` - we don't delete the existing stores that are prefixed with `vscode` I've done some testing on a dev build of Server Web on Mac and a local release build of Positron on Workbench on Ubuntu 24. ### QA Notes - this change impacts Positron Web / Server Web only - the data stores are working if: - you're seeing the renamed databases and stores in Developer Tools > Application > Storage > IndexedDB - the layout state is being persisted when you close and reopen Positron in the same browser; for example: 1. Open up a folder in Positron Web / Server Web 2. Command Prompt > View: Toggle Zen Mode 3. Close the browser 4. Open up the same folder in the same browser in Positron Web / Server Web 5. You should still be in Zen Mode --- src/vs/workbench/browser/web.main.ts | 12 ++++++++---- .../services/storage/browser/storageService.ts | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index a7772c273ed..294e19b7735 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -459,11 +459,15 @@ export class BrowserMain extends Disposable { // IndexedDB is used for logging and user data let indexedDB: IndexedDB | undefined; - const userDataStore = 'vscode-userdata-store'; - const logsStore = 'vscode-logs-store'; - const handlesStore = 'vscode-filehandles-store'; + // --- Start Positron --- + const userDataStore = 'positron-userdata-store'; + const logsStore = 'positron-logs-store'; + const handlesStore = 'positron-filehandles-store'; + // --- End Positron --- try { - indexedDB = await IndexedDB.create('vscode-web-db', 3, [userDataStore, logsStore, handlesStore]); + // --- Start Positron --- + indexedDB = await IndexedDB.create('positron-web-db', 3, [userDataStore, logsStore, handlesStore]); + // --- End Positron --- // Close onWillShutdown this.onWillShutdownDisposables.add(toDisposable(() => indexedDB?.close())); diff --git a/src/vs/workbench/services/storage/browser/storageService.ts b/src/vs/workbench/services/storage/browser/storageService.ts index 4d2d0815bb8..3207ad85d7c 100644 --- a/src/vs/workbench/services/storage/browser/storageService.ts +++ b/src/vs/workbench/services/storage/browser/storageService.ts @@ -339,7 +339,9 @@ export class IndexedDBStorageDatabase extends Disposable implements IIndexedDBSt } } - private static readonly STORAGE_DATABASE_PREFIX = 'vscode-web-state-db-'; + // --- Start Positron --- + private static readonly STORAGE_DATABASE_PREFIX = 'positron-web-state-db-'; + // --- End Positron --- private static readonly STORAGE_OBJECT_STORE = 'ItemTable'; private readonly _onDidChangeItemsExternal = this._register(new Emitter());