Update hashing

This commit is contained in:
Andras Schmelczer 2026-03-28 12:07:44 +00:00
parent 65d75dec40
commit 1c6cd80b64
3 changed files with 9 additions and 14 deletions

View file

@ -348,7 +348,7 @@ export class Syncer {
try {
const contentBytes =
await this.operations.read(relativePath); // this can throw FileNotFoundError
return hash(contentBytes);
return await hash(contentBytes);
} catch (e) {
if (
e instanceof Error &&

View file

@ -101,7 +101,7 @@ export class UnrestrictedSyncer {
const contentBytes = await this.operations.read(
document.relativePath
); // this can throw FileNotFoundError
const contentHash = hash(contentBytes);
const contentHash = await hash(contentBytes);
let response: DocumentVersion | DocumentUpdateResponse | undefined =
undefined;
@ -342,7 +342,7 @@ export class UnrestrictedSyncer {
{
documentId: remoteVersion.documentId,
parentVersionId: remoteVersion.vaultUpdateId,
hash: hash(contentBytes),
hash: await hash(contentBytes),
remoteRelativePath: remoteVersion.relativePath
},
this.database.createNewPendingDocument(
@ -513,7 +513,7 @@ export class UnrestrictedSyncer {
if (!("type" in response) || response.type === "MergingUpdate") {
const responseBytes = base64ToBytes(response.contentBase64);
contentHash = hash(responseBytes);
contentHash = await hash(responseBytes);
this.database.updateDocumentMetadata(
{