From 9854592a4c54152e82adbdfbc39f460c0e5111da Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 16 Mar 2026 17:06:26 +0700 Subject: [PATCH] TF-4368 Add more log trace for load more email --- .../data/repository/thread_repository_impl.dart | 6 ++++++ .../thread/presentation/thread_controller.dart | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/features/thread/data/repository/thread_repository_impl.dart b/lib/features/thread/data/repository/thread_repository_impl.dart index 196768fc5..fbb9c3cad 100644 --- a/lib/features/thread/data/repository/thread_repository_impl.dart +++ b/lib/features/thread/data/repository/thread_repository_impl.dart @@ -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; } diff --git a/lib/features/thread/presentation/thread_controller.dart b/lib/features/thread/presentation/thread_controller.dart index 678aa0ffb..3f225eaa4 100644 --- a/lib/features/thread/presentation/thread_controller.dart +++ b/lib/features/thread/presentation/thread_controller.dart @@ -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); }