diff --git a/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts b/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts index c7e01cd6..43cb5c7c 100644 --- a/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts +++ b/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts @@ -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);