Skip to content

Commit 70cb02a

Browse files
committed
Test fix
1 parent 439abb2 commit 70cb02a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lib/models/note/note.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ sealed class Note implements Comparable<Note> {
167167
int get hashCode => id.hashCode;
168168

169169
@ignore
170-
int get _idHash {
170+
int get _idHash => toIsarId(id);
171+
172+
/// Convert the [String] ID of the note to [int] ID used by isar.
173+
static int toIsarId(String id) {
171174
var hash = 0xcbf29ce484222325;
172175

173176
var i = 0;

lib/services/notes/notes_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class NotesService {
165165
query: search,
166166
filter: searchFilter,
167167
);
168-
final notesIds = searchResults.map((Map<String, dynamic> noteIndex) => noteIndex['id'] as int).toList();
168+
final notesIds = searchResults.map((Map<String, dynamic> noteIndex) => Note.toIsarId(noteIndex['id'])).toList();
169169

170170
final notes = (await getAllByIds(notesIds));
171171

0 commit comments

Comments
 (0)