Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/dev/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class ObjectEditor {
return this.openState(targetContext.secrets, key)
case 'auth':
// Auth memento is determined in a different way
return this.openState(getEnvironmentSpecificMemento(), key)
return this.openState(getEnvironmentSpecificMemento(globalState), key)
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/shared/utilities/mementos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ export function partition(memento: vscode.Memento, key: string): vscode.Memento
* with the local globalState. We want certain functionality to be isolated to
* the remote instance.
*/
export function getEnvironmentSpecificMemento(): vscode.Memento {
export function getEnvironmentSpecificMemento(globalState?: vscode.Memento): vscode.Memento {
if (!vscode.env.remoteName) {
// local compute: no further partitioning
return globals.globalState
return globalState ?? globals.globalState
}

const devEnvId = getCodeCatalystDevEnvId()

if (devEnvId !== undefined) {
// dev env: partition to dev env ID (compute backend might not always be the same)
return partition(globals.globalState, devEnvId)
return partition(globalState ?? globals.globalState, devEnvId)
}

// remote env: keeps a shared "global state" for all workspaces that report the same machine ID
return partition(globals.globalState, globals.machineId)
return partition(globalState ?? globals.globalState, globals.machineId)
}
Loading