Skip to content

Build your personal knowledge base with Trilium Notes

fix(server): edited notes listing automatically generated hidden notes (closes #5683)

Elian Dorane94b5ac07abd
diff --git a/apps/server/src/routes/api/revisions.ts b/apps/server/src/routes/api/revisions.ts
index 055d0b75ec..d126558f07 100644
--- a/apps/server/src/routes/api/revisions.ts
+++ b/apps/server/src/routes/api/revisions.ts
@@ -152,14 +152,14 @@ function restoreRevision(req: Request) {
}
function getEditedNotesOnDate(req: Request) {
- const noteIds = sql.getColumn<string>(
- `
+ const noteIds = sql.getColumn<string>(/*sql*/`\
SELECT notes.*
FROM notes
WHERE noteId IN (
SELECT noteId FROM notes
- WHERE notes.dateCreated LIKE :date
- OR notes.dateModified LIKE :date
+ WHERE
+ (notes.dateCreated LIKE :date OR notes.dateModified LIKE :date)
+ AND (noteId NOT LIKE '_%')
UNION ALL
SELECT noteId FROM revisions
WHERE revisions.dateLastEdited LIKE :date