Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
save sync records even if sync isn't configured, but don't put them as outstanding pushes (should be still available for pulls)
azivner45fba6d7f8a5
diff --git a/services/build.js b/services/build.jsindex 23a9cd9e65..d274a49c9d 100644--- a/services/build.js+++ b/services/build.js@@ -1 +1 @@-module.exports = { build_date:"2017-12-12T23:57:58-05:00", build_revision: "2fa57b79fd972b3eda6eb8ef1d26e9915b75fd96" };+module.exports = { build_date:"2017-12-13T23:36:38-05:00", build_revision: "180a7432caa0ca43986a24e7f911a64c48f8a134" };diff --git a/services/sync_table.js b/services/sync_table.jsindex f4c038087f..db1df019a3 100644--- a/services/sync_table.js+++ b/services/sync_table.js@@ -28,13 +28,17 @@ async function addRecentNoteSync(notePath, sourceId) {}async function addEntitySync(entityName, entityId, sourceId) {- if (sync_setup.isSyncSetup) {- await sql.replace("sync", {- entity_name: entityName,- entity_id: entityId,- sync_date: utils.nowDate(),- source_id: sourceId || source_id.currentSourceId- });+ await sql.replace("sync", {+ entity_name: entityName,+ entity_id: entityId,+ sync_date: utils.nowDate(),+ source_id: sourceId || source_id.currentSourceId+ });++ if (!sync_setup.isSyncSetup) {+ // this is because the "server" instances shouldn't have outstanding pushes+ // useful when you fork the DB for new "client" instance, it won't try to sync the whole DB+ await sql.execute("UPDATE options SET opt_value = (SELECT MAX(id) FROM sync) WHERE opt_name = 'last_synced_push'");}}