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
fix sync skipping some changes and then forcing sector queuing
zadambe59f248e838
diff --git a/bin/copy-trilium.sh b/bin/copy-trilium.shindex c9439f79b9..20797edfa6 100755--- a/bin/copy-trilium.sh+++ b/bin/copy-trilium.sh@@ -44,7 +44,7 @@ find $DIR/node_modules -name demo -exec rm -rf {} \;find $DIR/libraries -name "*.map" -type f -delete-rm -r $DIR/src/public/app+rm -rf $DIR/src/public/appsed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejssed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejsdiff --git a/src/services/sync.js b/src/services/sync.jsindex 210b3aa9f5..d764d1ba8c 100644--- a/src/services/sync.js+++ b/src/services/sync.js@@ -149,8 +149,8 @@ async function pullChanges(syncContext) {sql.transactional(() => {for (const {entityChange, entity} of entityChanges) {- const changeAppliedAlready = !entityChange.changeId- || !!sql.getValue("SELECT id FROM entity_changes WHERE changeId = ?", [entityChange.changeId]);+ const changeAppliedAlready = entityChange.changeId+ && !!sql.getValue("SELECT id FROM entity_changes WHERE changeId = ?", [entityChange.changeId]);if (!changeAppliedAlready && !sourceIdService.isLocalSourceId(entityChange.sourceId)) {if (!atLeastOnePullApplied) { // send only for first