Skip to content

Build your personal knowledge base with Trilium Notes

fix updating becca after undeleting notes

zadam1dfde76b95e2
diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js
index 4bbdafdb4d..30eb85688d 100644
--- a/src/public/app/services/tree.js
+++ b/src/public/app/services/tree.js
@@ -65,7 +65,7 @@ async function resolveNotePathToSegments(notePath, hoistedNoteId = 'root', logEr
if (!parents.length) {
if (logErrors) {
- ws.logError(`No parents found for ${childNoteId} (${child.title}) for path ${notePath}`);
+ ws.logError(`No parents found for note ${childNoteId} (${child.title}) for path ${notePath}`);
}
return;
diff --git a/src/services/notes.js b/src/services/notes.js
index 5b330efd6d..df227291db 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -634,7 +634,10 @@ function undeleteBranch(branchId, deleteId, taskContext) {
taskContext.increaseProgressCount();
if (note.isDeleted && note.deleteId === deleteId) {
- new Note(note).save();
+ // becca entity was already created as skeleton in "new Branch()" above
+ const noteEntity = becca.getNote(note.noteId);
+ noteEntity.updateFromRow(note);
+ noteEntity.save();
const attributes = sql.getRows(`
SELECT * FROM attributes