feat: Update deleted notes query to include notes with empty body in trash

This commit is contained in:
2026-05-21 17:10:23 +02:00
parent 62d47904d9
commit 48d09fe170
+9 -7
View File
@@ -217,13 +217,15 @@ class AppDatabase extends _$AppDatabase {
}
Future<List<DbNote>> 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<List<DbCategory>> getCategoriesChangedSince(DateTime since) {