Skip to content

Build your personal knowledge base with Trilium Notes

attribute sync fixes

azivner45a92313d574
diff --git a/services/content_hash.js b/services/content_hash.js
index f20a1c451d..424fe5e961 100644
--- a/services/content_hash.js
+++ b/services/content_hash.js
@@ -80,7 +80,18 @@ async function getHashes() {
date_modified,
date_created
FROM images
- ORDER BY image_id`))
+ ORDER BY image_id`)),
+
+ attributes: getHash(await sql.getAll(`
+ SELECT
+ attribute_id,
+ note_id
+ name,
+ value
+ date_modified,
+ date_created
+ FROM attributes
+ ORDER BY attribute_id`))
};
const elapseTimeMs = new Date().getTime() - startTime.getTime();
diff --git a/services/sync_update.js b/services/sync_update.js
index 8c667c2115..5807519d19 100644
--- a/services/sync_update.js
+++ b/services/sync_update.js
@@ -124,11 +124,11 @@ async function updateNoteImage(entity, sourceId) {
}
async function updateAttribute(entity, sourceId) {
- const origAttribute = await sql.getFirst("SELECT * FROM attribute WHERE attribute_id = ?", [entity.attribute_id]);
+ const origAttribute = await sql.getFirst("SELECT * FROM attributes WHERE attribute_id = ?", [entity.attribute_id]);
if (!origAttribute || origAttribute.date_modified <= entity.date_modified) {
await sql.doInTransaction(async () => {
- await sql.replace("attribute", entity);
+ await sql.replace("attributes", entity);
await sync_table.addAttributeSync(entity.attribute_id, sourceId);
});