diff --git a/embrace-android-sdk/config/detekt/baseline.xml b/embrace-android-sdk/config/detekt/baseline.xml
index fe686c784..a6174ec1d 100644
--- a/embrace-android-sdk/config/detekt/baseline.xml
+++ b/embrace-android-sdk/config/detekt/baseline.xml
@@ -2,11 +2,9 @@
- ArgumentListWrapping:LegacyExceptionInfoTest.kt$LegacyExceptionInfoTest$( "io.embrace.android.embracesdk.LegacyExceptionInfoTest.testOfThrowable(LegacyExceptionInfoTest.kt:45)", info.lines.first())
- ArgumentListWrapping:LegacyExceptionInfoTest.kt$LegacyExceptionInfoTest$("io.embrace.android.embracesdk.LegacyExceptionInfoTest.testOfThrowable(LegacyExceptionInfoTest.kt:45)", info.lines.first())
DataClassContainsFunctions:LegacyExceptionError.kt$LegacyExceptionError$fun addException(ex: Throwable?, appState: String?, clock: Clock)
DataClassContainsFunctions:LegacyExceptionError.kt$LegacyExceptionError$private fun getExceptionInfo(ex: Throwable?): List<LegacyExceptionInfo>
- DataClassShouldBeImmutable:LegacyExceptionError.kt$LegacyExceptionError$@Json(name = "c") var occurrences = 0
- DataClassShouldBeImmutable:LegacyExceptionError.kt$LegacyExceptionError$@Json(name = "rep") var exceptionErrors = mutableListOf<LegacyExceptionErrorInfo>()
+ DataClassShouldBeImmutable:LegacyExceptionError.kt$LegacyExceptionError$@Json(name = "c") var occurrences: Int = 0
+ DataClassShouldBeImmutable:LegacyExceptionError.kt$LegacyExceptionError$@Json(name = "rep") var exceptionErrors: MutableList<LegacyExceptionErrorInfo> = mutableListOf()
diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/behavior/SessionBehavior.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/behavior/SessionBehavior.kt
index d8b9789d1..256e39036 100644
--- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/behavior/SessionBehavior.kt
+++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/behavior/SessionBehavior.kt
@@ -22,22 +22,9 @@ internal class SessionBehavior(
) {
companion object {
-
- /**
- * By default, prevents to capture internal error logs as part of session payload
- */
- const val ERROR_LOG_STRICT_MODE_DEFAULT = false
-
const val SESSION_PROPERTY_LIMIT = 10
}
- /**
- * Whether the limit on the number of internal exceptions in the payload should be increased
- * for strict mode.
- */
- fun isSessionErrorLogStrictModeEnabled(): Boolean =
- local?.sessionEnableErrorLogStrictMode ?: ERROR_LOG_STRICT_MODE_DEFAULT
-
/**
* The whitelist of events (crashes, errors) that should send a full session payload even
* if the gating feature is enabled.
diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/local/SessionLocalConfig.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/local/SessionLocalConfig.kt
index 2d2eeadab..9f75eb3ec 100644
--- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/local/SessionLocalConfig.kt
+++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/config/local/SessionLocalConfig.kt
@@ -22,11 +22,5 @@ internal class SessionLocalConfig(
* gating feature is enabled.
*/
@Json(name = "send_full_for")
- val fullSessionEvents: Set? = null,
-
- /**
- * Local/Internal logs with ERROR severity are going to be captured as part of our session payload tp monitor potential issues
- */
- @Json(name = "error_log_strict_mode")
- val sessionEnableErrorLogStrictMode: Boolean? = null
+ val fullSessionEvents: Set? = null
)
diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SdkObservabilityModule.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SdkObservabilityModule.kt
index 1d901ee6d..89a1ef0dd 100644
--- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SdkObservabilityModule.kt
+++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/injection/SdkObservabilityModule.kt
@@ -18,16 +18,14 @@ internal class SdkObservabilityModuleImpl(
essentialServiceModule: EssentialServiceModule
) : SdkObservabilityModule {
- private val logStrictMode by lazy {
- val configService = essentialServiceModule.configService
- configService.sessionBehavior.isSessionErrorLogStrictModeEnabled()
- }
-
override val internalErrorService: InternalErrorService by singleton {
- EmbraceInternalErrorService(essentialServiceModule.processStateService, initModule.clock, logStrictMode)
+ EmbraceInternalErrorService(
+ essentialServiceModule.processStateService,
+ initModule.clock
+ )
}
override val reportingLoggerAction: ReportingLoggerAction by singleton {
- ReportingLoggerAction(internalErrorService, logStrictMode)
+ ReportingLoggerAction(internalErrorService)
}
}
diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorService.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorService.kt
index 3137af2f1..ba8bf7ed2 100644
--- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorService.kt
+++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorService.kt
@@ -20,8 +20,7 @@ import java.net.UnknownServiceException
*/
internal class EmbraceInternalErrorService(
private val processStateService: ProcessStateService,
- private val clock: Clock,
- private val logStrictMode: Boolean
+ private val clock: Clock
) : InternalErrorService {
private var configService: ConfigService? = null
private var err: LegacyExceptionError? = null
@@ -95,7 +94,7 @@ internal class EmbraceInternalErrorService(
return
}
if (err == null) {
- err = LegacyExceptionError(logStrictMode)
+ err = LegacyExceptionError()
}
// if the config service has not been set yet, capture the exception
diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/ReportingLoggerAction.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/ReportingLoggerAction.kt
index 3a03ef8c8..20c4257d8 100644
--- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/ReportingLoggerAction.kt
+++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/logging/ReportingLoggerAction.kt
@@ -3,8 +3,7 @@ package io.embrace.android.embracesdk.logging
import android.util.Log
internal class ReportingLoggerAction(
- private val internalErrorService: InternalErrorService,
- private val logStrictMode: Boolean = false
+ private val internalErrorService: InternalErrorService
) : InternalEmbraceLogger.LoggerAction {
override fun log(
@@ -13,16 +12,9 @@ internal class ReportingLoggerAction(
throwable: Throwable?,
logStacktrace: Boolean
) {
- val finalThrowable = when {
- logStrictMode && severity == InternalEmbraceLogger.Severity.ERROR && throwable == null -> LogStrictModeException(
- msg
- )
- else -> throwable
- }
-
- if (finalThrowable != null) {
+ if (throwable != null) {
try {
- internalErrorService.handleInternalError(finalThrowable)
+ internalErrorService.handleInternalError(throwable)
} catch (e: Throwable) {
// Yo dawg, I heard you like to handle internal errors...
Log.w(EMBRACE_TAG, msg, e)
@@ -30,7 +22,6 @@ internal class ReportingLoggerAction(
}
}
- class LogStrictModeException(msg: String) : Exception(msg)
class InternalError(msg: String) : Exception(msg)
class NotAnException(msg: String) : Exception(msg)
}
diff --git a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/LegacyExceptionError.kt b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/LegacyExceptionError.kt
index e2fc2233e..a4e77ec7c 100644
--- a/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/LegacyExceptionError.kt
+++ b/embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/payload/LegacyExceptionError.kt
@@ -9,13 +9,14 @@ import io.embrace.android.embracesdk.internal.payload.InternalError
* Describes an Exception Error with a count of occurrences and a list of exceptions (causes).
*/
@JsonClass(generateAdapter = true)
-internal data class LegacyExceptionError(@Transient private val logStrictMode: Boolean = false) {
+internal data class LegacyExceptionError(
@Json(name = "c")
- var occurrences = 0
+ var occurrences: Int = 0,
@Json(name = "rep")
- var exceptionErrors = mutableListOf()
+ var exceptionErrors: MutableList = mutableListOf()
+) {
/**
* Add a new exception error info if exceptionError's size is below 20.
@@ -26,11 +27,7 @@ internal data class LegacyExceptionError(@Transient private val logStrictMode: B
*/
fun addException(ex: Throwable?, appState: String?, clock: Clock) {
occurrences++
- var exceptionsLimits = DEFAULT_EXCEPTION_ERROR_LIMIT
- if (logStrictMode) {
- exceptionsLimits = DEFAULT_EXCEPTION_ERROR_LIMIT_STRICT_MODE
- }
- if (exceptionErrors.size < exceptionsLimits) {
+ if (exceptionErrors.size < DEFAULT_EXCEPTION_ERROR_LIMIT) {
exceptionErrors.add(
LegacyExceptionErrorInfo(
clock.now(),
@@ -61,4 +58,3 @@ internal data class LegacyExceptionError(@Transient private val logStrictMode: B
* The occurrences list limit.
*/
private const val DEFAULT_EXCEPTION_ERROR_LIMIT = 10
-private const val DEFAULT_EXCEPTION_ERROR_LIMIT_STRICT_MODE = 50
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/LocalConfigTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/LocalConfigTest.kt
index ae9658536..e98510951 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/LocalConfigTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/LocalConfigTest.kt
@@ -159,18 +159,6 @@ internal class LocalConfigTest {
@Test
fun testSessionOnlyConfig() {
var localConfig = LocalConfigParser.buildConfig(
- "GrCPU",
- false,
- "{\"session\": {\"error_log_strict_mode\": true}}",
- serializer,
- logger
- )
- assertTrue(
- checkNotNull(localConfig.sdkConfig.sessionConfig?.sessionEnableErrorLogStrictMode)
- )
-
- // receive a session component to restrict session messages
- localConfig = LocalConfigParser.buildConfig(
"GrCPU",
false,
"{\"session\": {\"components\": [\"breadcrumbs_taps\"]}}",
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionTest.kt
index cd4823261..551106925 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/SessionTest.kt
@@ -41,7 +41,7 @@ internal class SessionTest {
startupThreshold = 5000,
sdkStartupDuration = 109,
unhandledExceptions = 1,
- exceptionError = LegacyExceptionError(false),
+ exceptionError = LegacyExceptionError(),
orientations = listOf(Orientation(1, 16092342200)),
properties = mapOf("fake-key" to "fake-value"),
symbols = mapOf("fake-native-key" to "fake-native-value"),
@@ -92,7 +92,7 @@ internal class SessionTest {
assertEquals(5000L, startupThreshold)
assertEquals(109L, sdkStartupDuration)
assertEquals(1, unhandledExceptions)
- assertEquals(LegacyExceptionError(false), exceptionError)
+ assertEquals(LegacyExceptionError(), exceptionError)
assertEquals(listOf(Orientation(1, 16092342200)), orientations)
assertEquals(mapOf("fake-key" to "fake-value"), properties)
assertEquals(mapOf("fake-native-key" to "fake-native-value"), symbols)
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/behavior/SessionBehaviorTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/behavior/SessionBehaviorTest.kt
index 6daa115d5..ca0c9e9ba 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/behavior/SessionBehaviorTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/behavior/SessionBehaviorTest.kt
@@ -14,8 +14,7 @@ internal class SessionBehaviorTest {
private val local = SessionLocalConfig(
sessionComponents = setOf("breadcrumbs"),
- fullSessionEvents = setOf("crash"),
- sessionEnableErrorLogStrictMode = true
+ fullSessionEvents = setOf("crash")
)
private val remote = RemoteConfig(
@@ -30,7 +29,6 @@ internal class SessionBehaviorTest {
@Test
fun testDefaults() {
with(fakeSessionBehavior()) {
- assertFalse(isSessionErrorLogStrictModeEnabled())
assertEquals(emptySet(), getFullSessionEvents())
assertNull(getSessionComponents())
assertFalse(isGatingFeatureEnabled())
@@ -42,7 +40,6 @@ internal class SessionBehaviorTest {
@Test
fun testLocalOnly() {
with(fakeSessionBehavior(localCfg = { local })) {
- assertTrue(isSessionErrorLogStrictModeEnabled())
assertEquals(setOf("breadcrumbs"), getSessionComponents())
assertEquals(setOf("crash"), getFullSessionEvents())
assertTrue(isGatingFeatureEnabled())
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/local/SessionLocalConfigTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/local/SessionLocalConfigTest.kt
index d3a1f740d..c01c5d18d 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/local/SessionLocalConfigTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/config/local/SessionLocalConfigTest.kt
@@ -4,7 +4,6 @@ import io.embrace.android.embracesdk.deserializeEmptyJsonString
import io.embrace.android.embracesdk.deserializeJsonFromResource
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
-import org.junit.Assert.assertTrue
import org.junit.Test
internal class SessionLocalConfigTest {
@@ -18,7 +17,6 @@ internal class SessionLocalConfigTest {
@Test
fun testDeserialization() {
val obj = deserializeJsonFromResource("session_config.json")
- assertTrue(checkNotNull(obj.sessionEnableErrorLogStrictMode))
assertEquals(setOf("breadcrumbs"), obj.sessionComponents)
assertEquals(setOf("crash"), obj.fullSessionEvents)
}
@@ -30,7 +28,6 @@ internal class SessionLocalConfigTest {
}
private fun verifyDefaults(cfg: SessionLocalConfig) {
- assertNull(cfg.sessionEnableErrorLogStrictMode)
assertNull(cfg.sessionComponents)
assertNull(cfg.fullSessionEvents)
}
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeSdkObservabilityModule.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeSdkObservabilityModule.kt
index e799bbf8e..2ff9b9041 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeSdkObservabilityModule.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/fakes/injection/FakeSdkObservabilityModule.kt
@@ -10,8 +10,7 @@ import io.embrace.android.embracesdk.logging.ReportingLoggerAction
internal class FakeSdkObservabilityModule(
override val internalErrorService: InternalErrorService = EmbraceInternalErrorService(
FakeProcessStateService(),
- FakeClock(),
- true
+ FakeClock()
)
) : SdkObservabilityModule {
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorServiceTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorServiceTest.kt
index 00675cee8..8821667a5 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorServiceTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/EmbraceInternalErrorServiceTest.kt
@@ -24,7 +24,7 @@ internal class EmbraceInternalErrorServiceTest {
@Before
fun setUp() {
activityService = FakeProcessStateService()
- service = EmbraceInternalErrorService(activityService, clock, false)
+ service = EmbraceInternalErrorService(activityService, clock)
cfg = RemoteConfig()
cfgService =
FakeConfigService(dataCaptureEventBehavior = fakeDataCaptureEventBehavior { cfg })
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/ReportingLoggerActionTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/ReportingLoggerActionTest.kt
index b91e2843c..0867626fc 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/ReportingLoggerActionTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/logging/ReportingLoggerActionTest.kt
@@ -16,9 +16,9 @@ internal class ReportingLoggerActionTest {
private lateinit var reportingLoggerAction: ReportingLoggerAction
private lateinit var loggerAction: FakeLoggerAction
- private fun setupService(strictModeEnabled: Boolean = false) {
+ private fun setupService() {
internalErrorService = mockk(relaxUnitFun = true)
- reportingLoggerAction = ReportingLoggerAction(internalErrorService, strictModeEnabled)
+ reportingLoggerAction = ReportingLoggerAction(internalErrorService)
}
@Before
@@ -39,7 +39,7 @@ internal class ReportingLoggerActionTest {
setupService()
reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.DEBUG, exception, true)
- verify { internalErrorService.handleInternalError(exception) }
+ verify(exactly = 1) { internalErrorService.handleInternalError(exception) }
}
@Test
@@ -47,49 +47,20 @@ internal class ReportingLoggerActionTest {
setupService()
every { internalErrorService.handleInternalError(exception) } throws RuntimeException()
reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.DEBUG, exception, true)
- verify { internalErrorService.handleInternalError(exception) }
+ verify(exactly = 1) { internalErrorService.handleInternalError(exception) }
}
@Test
- fun `if logStrictMode is enabled and a throwable is available with ERROR severity`() {
- setupService(true)
- reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.ERROR, exception, true)
- verify { internalErrorService.handleInternalError(exception) }
- }
-
- @Test
- fun `if logStrictMode is enabled and a throwable is not available with ERROR severity then handle exception`() {
- setupService(true)
- reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.ERROR, null, true)
- verify(exactly = 1) {
- internalErrorService.handleInternalError(
- any() as ReportingLoggerAction.LogStrictModeException
- )
- }
- }
-
- @Test
- fun `if logStrictMode is enabled and a throwable is not available with INFO severity then dont handle exception`() {
- setupService(true)
+ fun `if a throwable is not available with INFO severity then dont handle exception`() {
+ setupService()
reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.INFO, null, true)
verify(exactly = 0) { internalErrorService.handleInternalError(any() as Exception) }
}
@Test
- fun `if logStrictMode is disabled and a throwable is available with ERROR severity`() {
- setupService(false)
+ fun `if a throwable is available with ERROR severity`() {
+ setupService()
reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.ERROR, exception, true)
- verify { internalErrorService.handleInternalError(exception) }
- }
-
- @Test
- fun `if logStrictMode is enabled and an exception is thrown, swallow it`() {
- setupService(true)
- every {
- internalErrorService.handleInternalError(any() as ReportingLoggerAction.LogStrictModeException)
- } throws RuntimeException()
-
- reportingLoggerAction.log(errorMsg, InternalEmbraceLogger.Severity.DEBUG, exception, true)
- verify { internalErrorService.handleInternalError(any() as ReportingLoggerAction.LogStrictModeException) }
+ verify(exactly = 1) { internalErrorService.handleInternalError(exception) }
}
}
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityTest.kt
index c4e46c3bd..1d4d3cf5d 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/BackgroundActivityTest.kt
@@ -27,7 +27,7 @@ internal class BackgroundActivityTest {
infoLogsAttemptedToSend = 1,
warnLogsAttemptedToSend = 2,
errorLogsAttemptedToSend = 3,
- exceptionError = LegacyExceptionError(false),
+ exceptionError = LegacyExceptionError(),
crashReportId = "fake-crash-id",
endType = Session.LifeEventType.BKGND_STATE,
startType = Session.LifeEventType.BKGND_STATE,
@@ -65,7 +65,7 @@ internal class BackgroundActivityTest {
assertEquals(Session.LifeEventType.BKGND_STATE, endType)
assertEquals(Session.LifeEventType.BKGND_STATE, startType)
assertEquals(1, unhandledExceptions)
- assertEquals(LegacyExceptionError(false), exceptionError)
+ assertEquals(LegacyExceptionError(), exceptionError)
assertEquals(mapOf("fake-key" to "fake-value"), properties)
}
}
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/LegacyExceptionErrorTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/LegacyExceptionErrorTest.kt
index ce6c97e0a..40e1e4e5f 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/LegacyExceptionErrorTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/payload/LegacyExceptionErrorTest.kt
@@ -30,15 +30,15 @@ internal class LegacyExceptionErrorTest {
@Test
fun `serialize then deserialize default object`() {
- val obj = LegacyExceptionError(false)
+ val obj = LegacyExceptionError()
assertJsonMatchesGoldenFile("exception_error_expected.json", obj)
val other = deserializeJsonFromResource("exception_error_expected.json")
assertEquals(obj, other)
}
@Test
- fun `test addException with strict mode disabled has a limit of 10 exceptions`() {
- exceptionError = LegacyExceptionError(false)
+ fun `test addException has a limit of 10 exceptions`() {
+ exceptionError = LegacyExceptionError()
val max = 10
repeat(max + 1) {
exceptionError.addException(Throwable("exceptions"), "state", clock)
@@ -47,20 +47,4 @@ internal class LegacyExceptionErrorTest {
assertEquals(exceptionError.exceptionErrors.size, max)
assertEquals(exceptionError.occurrences, max + 1)
}
-
- @Test
- fun `test addException with strict mode enabled has a limit of 50 exceptions`() {
- exceptionError = LegacyExceptionError(true)
- val throwable = Throwable("exceptions")
-
- repeat(50) {
- exceptionError.addException(throwable, "state", clock)
- }
-
- assertEquals(exceptionError.exceptionErrors.size, 50)
- assertEquals(exceptionError.occurrences, 50)
- exceptionError.addException(throwable, "state", clock)
- assertEquals(exceptionError.exceptionErrors.size, 50)
- assertEquals(exceptionError.occurrences, 51)
- }
}
diff --git a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt
index cbcaf2238..46c03a636 100644
--- a/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt
+++ b/embrace-android-sdk/src/test/java/io/embrace/android/embracesdk/session/SessionHandlerTest.kt
@@ -74,7 +74,7 @@ internal class SessionHandlerTest {
private val logMessageService: LogMessageService = FakeLogMessageService()
private val clock = FakeClock()
private val internalErrorService =
- EmbraceInternalErrorService(FakeProcessStateService(), clock, false)
+ EmbraceInternalErrorService(FakeProcessStateService(), clock)
private const val now = 123L
private var sessionNumber = 5
private val sessionProperties: EmbraceSessionProperties = mockk(relaxed = true)