Skip to content

Commit 9f70132

Browse files
authored
Fix storing cloud changes with deleted file (microsoft#185037)
1 parent b7fd221 commit 9f70132

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,14 +707,15 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
707707

708708
hasEdits = true;
709709

710-
const contents = encodeBase64((await this.fileService.readFile(uri)).value);
711-
editSessionSize += contents.length;
712-
if (editSessionSize > this.editSessionsStorageService.SIZE_LIMIT) {
713-
this.notificationService.error(localize('payload too large', 'Your working changes exceed the size limit and cannot be stored.'));
714-
return undefined;
715-
}
716710

717711
if (await this.fileService.exists(uri)) {
712+
const contents = encodeBase64((await this.fileService.readFile(uri)).value);
713+
editSessionSize += contents.length;
714+
if (editSessionSize > this.editSessionsStorageService.SIZE_LIMIT) {
715+
this.notificationService.error(localize('payload too large', 'Your working changes exceed the size limit and cannot be stored.'));
716+
return undefined;
717+
}
718+
718719
workingChanges.push({ type: ChangeType.Addition, fileType: FileType.File, contents: contents, relativeFilePath: relativeFilePath });
719720
} else {
720721
// Assume it's a deletion

0 commit comments

Comments
 (0)