325
326
private async cleanupTransferredSession(sessionResource: URI): Promise<void> {
328
>
// Remove from index
329
>
const index = this.getTransferredSessionIndex();
330
>
const workspaceFolders = this.workspaceContextService.getWorkspace().folders;
331
>
if (workspaceFolders.length === 1) {
332
>
const workspaceKey = workspaceFolders[0].uri.toString();
333
>
delete index[workspaceKey];
334
>
this.storageService.store(ChatTransferIndexStorageKey, index, StorageScope.PROFILE, StorageTarget.MACHINE);
335
>
}
336
>
337
>
// Delete the transferred session file
338
>
const storageLocation = this.getTransferredSessionStorageLocation(sessionResource);
339
>
await this.fileService.del(storageLocation);
340
>
} catch (e) {
341
if (toFileOperationResult(e) !== FileOperationResult.FILE_NOT_FOUND) {
342
this.reportError('cleanupTransferredSession', 'Error cleaning up transferred session', e);
343
}
344
}
346
347
private _didReportIssue = false;