TF-3113 Fix cannot empty spam on mobile (#3129)

This commit is contained in:
Dat Vu
2024-09-10 18:09:24 +07:00
committed by GitHub
parent 9281262712
commit f2a20970aa
3 changed files with 65 additions and 26 deletions
@@ -66,12 +66,13 @@ class ThreadIsolateWorker {
EmptyMailboxFolderArguments args,
TypeSendPort sendPort
) async {
final rootIsolateToken = args.isolateToken;
BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken);
await HiveCacheConfig.instance.setUp();
List<EmailId> emailListCompleted = List.empty(growable: true);
try {
final rootIsolateToken = args.isolateToken;
BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken);
await HiveCacheConfig.instance.setUp();
List<EmailId> emailListCompleted = List.empty(growable: true);
var hasEmails = true;
Email? lastEmail;
@@ -104,11 +105,12 @@ class ThreadIsolateWorker {
hasEmails = false;
}
}
log('ThreadIsolateWorker::_emptyMailboxFolderAction(): TOTAL_REMOVE: ${emailListCompleted.length}');
return emailListCompleted;
} catch (e) {
log('ThreadIsolateWorker::_emptyMailboxFolderAction(): ERROR: $e');
logError('ThreadIsolateWorker::_emptyMailboxFolderAction(): ERROR: $e');
rethrow;
}
log('ThreadIsolateWorker::_emptyMailboxFolderAction(): TOTAL_REMOVE: ${emailListCompleted.length}');
return emailListCompleted;
}
Future<List<EmailId>> _emptyMailboxFolderOnWeb(