fix(test): sync before searching in second searchEmails IMAP test

The searchEmails implementation now queries local SQLite FTS5 (not IMAP),
so syncEmails must be called first to populate the index. The first test
was already fixed; this adds the same syncEmails call to the second test
and adds a clarifying comment to the implementation.

Closes #506

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Guettler
2026-06-07 00:49:05 +00:00
co-authored by Claude Sonnet 4.6
parent d55b316d4c
commit 6853ad130f
2 changed files with 3 additions and 0 deletions
@@ -3101,6 +3101,8 @@ class EmailRepositoryImpl implements EmailRepository {
}
@override
// Results are limited to emails already synced into the local SQLite FTS5
// index; call syncEmails first to ensure the index is up-to-date.
Future<List<model.Email>> searchEmails(
String accountId,
String mailboxPath,
@@ -433,6 +433,7 @@ void main() {
final r = makeRepo();
await r.accounts.addAccount(account, userPass);
await r.emails.syncEmails('test', 'INBOX');
final results = await r.emails.searchEmails(
'test',