TF-4368 Add more log trace for load more email

This commit is contained in:
dab246
2026-03-16 17:06:26 +07:00
committed by Dat H. Pham
parent 7ecf5d8e53
commit 9854592a4c
2 changed files with 17 additions and 2 deletions
@@ -410,6 +410,12 @@ class ThreadRepositoryImpl extends ThreadRepository {
newDestroyed: response.notFoundEmailIds,
);
}
logTrace(
'ThreadRepositoryImpl::loadMoreEmails(): emailList = ${response.emailList?.length},'
'notFoundEmailIds = ${response.notFoundEmailIds?.length}, '
'existNotFoundEmails = ${response.existNotFoundEmails}, '
'state = ${response.state?.value}',
);
yield response;
}
@@ -834,7 +834,13 @@ class ThreadController extends BaseController with EmailActionController {
final oldestEmail = mailboxDashBoardController.emailsInCurrentMailbox.isNotEmpty
? mailboxDashBoardController.emailsInCurrentMailbox.last
: null;
log('ThreadController::_loadMoreEmails: OldestEmailID = ${oldestEmail?.id?.asString}');
final useCache = selectedMailbox?.isCacheable ?? false;
final filterOption = mailboxDashBoardController.filterMessageOption.value;
logTrace(
'ThreadController::_loadMoreEmails: OldestEmailID = ${oldestEmail?.id?.asString}, '
'useCache = $useCache, '
'filterOption = ${filterOption.name}',
);
consumeState(_loadMoreEmailsInMailboxInteractor.execute(
GetEmailRequest(
_session!,
@@ -876,7 +882,10 @@ class ThreadController extends BaseController with EmailActionController {
canLoadMore = success.emailList.isNotEmpty;
loadingMoreStatus.value = LoadingMoreStatus.completed;
final appendableList = validateListEmailsLoadMore(success.emailList);
log('ThreadController::_loadMoreEmailsSuccess: emailList = ${success.emailList.length} | appendableList = ${appendableList.length}');
logTrace(
'ThreadController::_loadMoreEmailsSuccess: emailList = ${success.emailList.length}, '
'appendableList = ${appendableList.length}',
);
if (appendableList.isNotEmpty) {
mailboxDashBoardController.emailsInCurrentMailbox.addAll(appendableList);
}