Always fetch the right document version content

This commit is contained in:
Andras Schmelczer 2025-12-06 11:44:57 +00:00
parent bfe3e9aeeb
commit a1bda41646
2 changed files with 43 additions and 7 deletions

View file

@ -413,11 +413,11 @@ export class UnrestrictedSyncer {
return;
}
const content = (
await this.syncService.get({
documentId: remoteVersion.documentId
})
).contentBase64;
const contentBytes =
await this.syncService.getDocumentVersionContent({
documentId: remoteVersion.documentId,
vaultUpdateId: remoteVersion.vaultUpdateId
});
// We're trying to create an entirely new document that didn't exist locally
document = this.database.getDocumentByDocumentId(
@ -431,8 +431,6 @@ export class UnrestrictedSyncer {
return;
}
const contentBytes = base64ToBytes(content);
await this.operations.ensureClearPath(remoteVersion.relativePath);
const [promise, resolve] = createPromise();