99
100
private async handleWorkspaceTransition(oldWorkspace: IAnyWorkspaceIdentifier, newWorkspace: IAnyWorkspaceIdentifier): Promise<void> {
102
>
const isNewWorkspaceEmpty = isEmptyWorkspaceIdentifier(newWorkspace);
103
>
const oldWorkspaceId = oldWorkspace.id;
104
>
const newWorkspaceId = newWorkspace.id;
105
>
106
>
this.logService.info(`ChatSessionStore: Workspace transition from ${oldWorkspaceId} to ${newWorkspaceId}`);
107
>
108
>
// Determine the old storage location based on the old workspace
109
>
const oldStorageRoot = wasEmptyWindow ?
110
>
joinPath(this.userDataProfilesService.defaultProfile.globalStorageHome, 'emptyWindowChatSessions') :
111
joinPath(this.environmentService.workspaceStorageHome, oldWorkspaceId, 'chatSessions');
113
>
// Determine the new storage location based on the new workspace
114
>
const newStorageRoot = isNewWorkspaceEmpty ?
115
joinPath(this.userDataProfilesService.defaultProfile.globalStorageHome, 'emptyWindowChatSessions') :
116
joinPath(this.environmentService.workspaceStorageHome, newWorkspaceId, 'chatSessions');
118
>
// If the storage roots are identical, there is nothing to migrate
119
>
if (isEqual(oldStorageRoot, newStorageRoot)) {
120
this.storageRoot = newStorageRoot;
121
return;