From 48d09fe17007b0d8de80c87d60f5a5cd4b52a6ee Mon Sep 17 00:00:00 2001 From: Marcos Date: Thu, 21 May 2026 17:10:23 +0200 Subject: [PATCH] feat: Update deleted notes query to include notes with empty body in trash --- lib/data/app_database.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/data/app_database.dart b/lib/data/app_database.dart index 1c8484c..555b778 100644 --- a/lib/data/app_database.dart +++ b/lib/data/app_database.dart @@ -217,13 +217,15 @@ class AppDatabase extends _$AppDatabase { } Future> getDeletedNotes() { - return (select(notes)..where( - (n) => - n.isDeleted.equals(true) & - n.title.isNotValue('') & - n.body.isNotValue(''), - )) - .get(); + // A note is considered deleted (in the trash) when `is_deleted` is true + // and at least one of `title` or `body` is not empty. Previously the + // query required both title AND body to be non-empty which excluded + // notes that had an empty body (common) from appearing in the trash. + return (select(notes)..where( + (n) => n.isDeleted.equals(true) & + (n.title.isNotValue('') | n.body.isNotValue('')), + )) + .get(); } Future> getCategoriesChangedSince(DateTime since) {