Skip to content

Commit

Permalink
Merge pull request #1752 from bugsnag/PLAT-8970/deliver-on-crash-tele…
Browse files Browse the repository at this point in the history
…metry

Add telemetry for `attemptDeliveryOnCrash` config
  • Loading branch information
lemnik authored Oct 5, 2022
2 parents 631e7dd + c680081 commit 75646d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ internal class ConfigInternal(
}

fun getConfigDifferences(): Map<String, Any> {
// allocate a local ConfigInternal with all-defaults to compare against
val defaultConfig = ConfigInternal("")

return listOfNotNull(
if (plugins.count() > 0) "pluginCount" to plugins.count() else null,
if (autoDetectErrors != defaultConfig.autoDetectErrors)
Expand Down Expand Up @@ -138,6 +141,8 @@ internal class ConfigInternal(
"persistenceDirectorySet" to true else null,
if (sendThreads != defaultConfig.sendThreads)
"sendThreads" to sendThreads else null,
if (attemptDeliveryOnCrash != defaultConfig.attemptDeliveryOnCrash)
"attemptDeliveryOnCrash" to attemptDeliveryOnCrash else null
).toMap()
}

Expand All @@ -155,7 +160,5 @@ internal class ConfigInternal(
protected fun load(context: Context, apiKey: String?): Configuration {
return ManifestConfigLoader().load(context, apiKey)
}

private val defaultConfig = ConfigInternal("")
}
}
1 change: 1 addition & 0 deletions features/full_tests/crash_handler.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Feature: Reporting with other exception handlers installed
And the error payload field "events" is an array with 1 elements
And the exception "errorClass" equals "java.lang.RuntimeException"
And the exception "message" equals "DeliverOnCrashScenario"
And the event "usage.config.attemptDeliveryOnCrash" is true

0 comments on commit 75646d1

Please sign in to comment.