DataDog / dd-sdk-flutter

Flutter bindings and tools for utilizing Datadog Mobile SDKs
Apache License 2.0
41 stars 40 forks source link

fix: Do not repeatedly send errors if the method channel is disconnected #610

Closed fuzzybinary closed 1 month ago

fuzzybinary commented 1 month ago

What and why?

We have some reports of the MethodChannel becoming disconnected on Android, which will cause methods sent to the Datadog Flutter Plugin to throw MissingPluginException. We do not handle / catch these errors, and instead pass them on to Flutter by design.

However, if a user has setup errors to be automatically logged to Datadog, it's possible these errors can result in an infiniate loop attempting to send the error to Datadog.

This change prevents that loop by looking for MissingPluginException that contains our method channel datadog_sdk_plugin and discards it.

Review checklist