Fix bug where we didn't update hash on updates

This commit is contained in:
Andras Schmelczer 2025-04-04 23:14:37 +01:00
parent 648db73628
commit 69438a78c6
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -236,6 +236,14 @@ export class UnrestrictedSyncer {
const responseBytes = deserialize(response.contentBase64);
contentHash = hash(responseBytes);
this.database.updateDocumentMetadata(
{
parentVersionId: response.vaultUpdateId,
hash: contentHash
},
document
);
await this.operations.write(
actualPath,
contentBytes,
@ -250,6 +258,14 @@ export class UnrestrictedSyncer {
type: SyncType.UPDATE
});
}
} else {
this.database.updateDocumentMetadata(
{
parentVersionId: response.vaultUpdateId,
hash: contentHash
},
document
);
}
this.tryIncrementVaultUpdateId(response.vaultUpdateId);