From ca0506c5f6b49da5644697bb2f5b29d135a8d201 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:41:56 -0700 Subject: [PATCH] fix: delete unique-db patch This was supposed to be removed in https://github.com/coder/code-server/pull/5519 Looks like I didn't update the series or actually delete the patch. --- patches/series | 1 - patches/unique-db.diff | 36 ------------------------------------ 2 files changed, 37 deletions(-) delete mode 100644 patches/unique-db.diff diff --git a/patches/series b/patches/series index e5289b4bd..f6fd05b66 100644 --- a/patches/series +++ b/patches/series @@ -10,7 +10,6 @@ logout.diff store-socket.diff proxy-uri.diff github-auth.diff -unique-db.diff log-level.diff local-storage.diff service-worker.diff diff --git a/patches/unique-db.diff b/patches/unique-db.diff deleted file mode 100644 index f03a3a933..000000000 --- a/patches/unique-db.diff +++ /dev/null @@ -1,36 +0,0 @@ -Prevent state collisions - -Previously if you opened different workspaces that had the same filesystem path -(for example if you have /home/coder on two different machines that are both -accessed through the same host) they would conflict with each other. This -ensures that different browser paths will be unique (for example /workspace1 and -/workspace2). - -The easiest way to test is to open files in the same workspace using both / and -/vscode and make sure they are not interacting with each other. - -Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts -=================================================================== ---- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts -+++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts -@@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi - import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; - import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; - import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; -+import { hash } from 'vs/base/common/hash'; - - export class BrowserStorageService extends AbstractStorageService { - -@@ -67,7 +68,11 @@ export class BrowserStorageService exten - return `global-${this.profileStorageProfile.id}`; - } - case StorageScope.WORKSPACE: -- return this.payload.id; -+ // Add a unique ID based on the current path for per-workspace databases. -+ // This prevents workspaces on different machines that share the same domain -+ // and file path from colliding (since it does not appear IndexedDB can be -+ // scoped to a path) as long as they are hosted on different paths. -+ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16); - } - } -