mirror of
https://github.com/zadam/trilium.git
synced 2025-01-17 20:48:12 +08:00
sync error mitigation
This commit is contained in:
parent
eb4dfbad92
commit
21fab412cb
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,8 @@ async function getNotesAndBranches(noteIds) {
|
||||||
|
|
||||||
noteIds = notes.map(n => n.noteId);
|
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' parent
|
||||||
const branches = await sql.getManyRows(`
|
const branches = await sql.getManyRows(`
|
||||||
SELECT
|
SELECT
|
||||||
branches.branchId,
|
branches.branchId,
|
||||||
|
@ -19,6 +21,7 @@ async function getNotesAndBranches(noteIds) {
|
||||||
branches.prefix,
|
branches.prefix,
|
||||||
branches.isExpanded
|
branches.isExpanded
|
||||||
FROM branches
|
FROM branches
|
||||||
|
JOIN notes AS child ON child.noteId = branches.noteId
|
||||||
WHERE branches.isDeleted = 0
|
WHERE branches.isDeleted = 0
|
||||||
AND (branches.noteId IN (???) OR parentNoteId IN (???))`, noteIds);
|
AND (branches.noteId IN (???) OR parentNoteId IN (???))`, noteIds);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue