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
sync error mitigation
zadam21fab412cbd3
diff --git a/src/routes/api/tree.js b/src/routes/api/tree.jsindex 7bf7901c6d..eaa478f1be 100644--- a/src/routes/api/tree.js+++ b/src/routes/api/tree.js@@ -10,6 +10,8 @@ async function getNotesAndBranches(noteIds) {noteIds = notes.map(n => n.noteId);+ // joining child note to filter out not completely synchronised notes which would then cause errors later+ // cannot do that with parent because of root note's 'none' parentconst branches = await sql.getManyRows(`SELECTbranches.branchId,@@ -19,6 +21,7 @@ async function getNotesAndBranches(noteIds) {branches.prefix,branches.isExpandedFROM branches+ JOIN notes AS child ON child.noteId = branches.noteIdWHERE branches.isDeleted = 0AND (branches.noteId IN (???) OR parentNoteId IN (???))`, noteIds);