Skip to content

Commit

Permalink
fix: Countly crash [WPB-14415] (#3649)
Browse files Browse the repository at this point in the history
Co-authored-by: Oussama Hassine <[email protected]>
  • Loading branch information
m-zagorski and ohassine authored Nov 20, 2024
1 parent 4caa4ff commit 8a30ee1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.wire.android.feature.analytics.model.AnalyticsEventConstants
import com.wire.android.feature.analytics.model.AnalyticsSettings
import ly.count.android.sdk.Countly
import ly.count.android.sdk.CountlyConfig
import ly.count.android.sdk.UtilsInternalLimits

class AnonymousAnalyticsRecorderImpl : AnonymousAnalyticsRecorder {

Expand Down Expand Up @@ -73,8 +74,13 @@ class AnonymousAnalyticsRecorderImpl : AnonymousAnalyticsRecorder {
Countly.sharedInstance().onStop()
}

/**
* We need to change our segmentation map to [MutableMap] because
* Countly is doing additional operations on it.
* See [UtilsInternalLimits.removeUnsupportedDataTypes]
*/
override fun sendEvent(event: AnalyticsEvent) {
Countly.sharedInstance().events().recordEvent(event.key, event.toSegmentation())
Countly.sharedInstance().events().recordEvent(event.key, event.toSegmentation().toMutableMap())
}

override fun halt() {
Expand Down

0 comments on commit 8a30ee1

Please sign in to comment.