From 0c98611e6b43803a9d5dba222d7023b569abfb49 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 27 Nov 2023 17:28:38 -0900 Subject: [PATCH] Ensure we only ever set workspace initialized to true This is just a guard in case there are paths where the workspace is already marked as initialized but the workspace configuration is not and we end up actually un-initializing it. --- patches/local-storage.diff | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/patches/local-storage.diff b/patches/local-storage.diff index 45827be98621..17ef52a937bd 100644 --- a/patches/local-storage.diff +++ b/patches/local-storage.diff @@ -79,12 +79,16 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co }); })); -@@ -550,6 +552,8 @@ export class WorkspaceService extends Di +@@ -550,6 +552,12 @@ export class WorkspaceService extends Di previousFolders = this.workspace.folders; this.workspace.update(workspace); } else { -+ // The configuration could have updated before the promise resolved. -+ workspace.initialized = this.workspaceConfiguration.initialized; ++ // It is possible for the configuration to become initialized in between ++ // when the workspace was created and this function was called, so check ++ // the configuration again now. ++ if (!workspace.initialized && this.workspaceConfiguration.initialized) { ++ workspace.initialized = true; ++ } this.workspace = workspace; }