From 3936364a494dfd199c0d41d657fc5e2012c5f3e6 Mon Sep 17 00:00:00 2001 From: XichengSpencer <74568012+XichengSpencer@users.noreply.github.com> Date: Tue, 4 Jul 2023 01:01:51 -0400 Subject: [PATCH 1/2] Resolve the test build error --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle b/app/build.gradle index 34aeccd28b1..71b759c6475 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -210,6 +210,7 @@ dependencies { 'androidx.test.espresso:espresso-core:3.2.0', 'androidx.test.espresso:espresso-intents:3.1.0', 'androidx.test.ext:junit:1.1.1', + 'androidx.test.ext:truth:1.4.0', 'com.github.bumptech.glide:mocks:4.11.0', 'com.google.truth:truth:1.1.3', 'androidx.work:work-testing:2.4.0', From 885b9c9d14380467c5e31c2548bc6d112498be30 Mon Sep 17 00:00:00 2001 From: XichengSpencer <74568012+XichengSpencer@users.noreply.github.com> Date: Tue, 7 May 2024 17:00:17 -0400 Subject: [PATCH 2/2] Add logException to exceptionLogger in AnalyticsController.kt The rest files seem already comply to what TODOs suggest Also removed unnecessary TODOs --- .../android/domain/oppialogger/analytics/AnalyticsController.kt | 1 - .../oppialogger/analytics/PerformanceMetricsController.kt | 1 - .../domain/oppialogger/exceptions/ExceptionsController.kt | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/AnalyticsController.kt b/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/AnalyticsController.kt index 686ad0c864a..6de1f35fa92 100644 --- a/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/AnalyticsController.kt +++ b/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/AnalyticsController.kt @@ -199,7 +199,6 @@ class AnalyticsController @Inject constructor( .addEventLogsToUpload(eventLog) .build() } else { - // TODO(#1433): Refactoring for logging exceptions to both console and exception loggers. val exception = IllegalStateException("Least Recent Event index absent -- EventLogCacheStoreSize is 0") consoleLogger.e("AnalyticsController", "Failure while caching event.", exception) diff --git a/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/PerformanceMetricsController.kt b/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/PerformanceMetricsController.kt index 710679e58f3..f518ff6121e 100644 --- a/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/PerformanceMetricsController.kt +++ b/domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/PerformanceMetricsController.kt @@ -81,7 +81,6 @@ class PerformanceMetricsController @Inject constructor( .addOppiaMetricLog(oppiaMetricLog) .build() } else { - // TODO(#1433): Refactoring for logging exceptions to both console and exception loggers. val exception = IllegalStateException( "Least Recent Event index absent -- MetricLogStorageCacheSize is 0" diff --git a/domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions/ExceptionsController.kt b/domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions/ExceptionsController.kt index 2e1e059f809..026156cf0cd 100644 --- a/domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions/ExceptionsController.kt +++ b/domain/src/main/java/org/oppia/android/domain/oppialogger/exceptions/ExceptionsController.kt @@ -131,12 +131,12 @@ class ExceptionsController @Inject constructor( .addExceptionLog(exceptionLog) .build() } else { - // TODO(#1433): Refactoring for logging exceptions to both console and exception loggers. val exception = NullPointerException( "Least Recent Exception index absent -- ExceptionLogCacheStoreSize is 0" ) consoleLogger.e(EXCEPTIONS_CONTROLLER, exception.toString()) + exceptionLogger.logException(exception) } } return@storeDataAsync oppiaExceptionLogs.toBuilder().addExceptionLog(exceptionLog).build()