Merge remote-tracking branch 'origin/develop' into rav/more_posthog_props
This commit is contained in:
commit
65abdb656b
3 changed files with 38 additions and 7 deletions
|
|
@ -173,7 +173,7 @@ jsoup = "org.jsoup:jsoup:1.18.1"
|
||||||
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
|
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
|
||||||
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
|
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
|
||||||
timber = "com.jakewharton.timber:timber:5.0.1"
|
timber = "com.jakewharton.timber:timber:5.0.1"
|
||||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.2.70"
|
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.2.71"
|
||||||
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
|
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
|
||||||
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
|
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
|
||||||
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
|
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@ package io.element.android.libraries.matrix.impl.analytics
|
||||||
|
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import im.vector.app.features.analytics.plan.Error
|
import im.vector.app.features.analytics.plan.Error
|
||||||
|
import io.element.android.libraries.matrix.impl.fixtures.factories.aRustUnableToDecryptInfo
|
||||||
import io.element.android.libraries.matrix.test.AN_EVENT_ID
|
import io.element.android.libraries.matrix.test.AN_EVENT_ID
|
||||||
import io.element.android.services.analytics.test.FakeAnalyticsService
|
import io.element.android.services.analytics.test.FakeAnalyticsService
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.matrix.rustcomponents.sdk.UnableToDecryptInfo
|
|
||||||
import uniffi.matrix_sdk_crypto.UtdCause
|
import uniffi.matrix_sdk_crypto.UtdCause
|
||||||
|
|
||||||
class UtdTrackerTest {
|
class UtdTrackerTest {
|
||||||
|
|
@ -21,7 +21,7 @@ class UtdTrackerTest {
|
||||||
val fakeAnalyticsService = FakeAnalyticsService()
|
val fakeAnalyticsService = FakeAnalyticsService()
|
||||||
val sut = UtdTracker(fakeAnalyticsService)
|
val sut = UtdTracker(fakeAnalyticsService)
|
||||||
sut.onUtd(
|
sut.onUtd(
|
||||||
UnableToDecryptInfo(
|
aRustUnableToDecryptInfo(
|
||||||
eventId = AN_EVENT_ID.value,
|
eventId = AN_EVENT_ID.value,
|
||||||
timeToDecryptMs = null,
|
timeToDecryptMs = null,
|
||||||
cause = UtdCause.UNKNOWN,
|
cause = UtdCause.UNKNOWN,
|
||||||
|
|
@ -46,7 +46,7 @@ class UtdTrackerTest {
|
||||||
val fakeAnalyticsService = FakeAnalyticsService()
|
val fakeAnalyticsService = FakeAnalyticsService()
|
||||||
val sut = UtdTracker(fakeAnalyticsService)
|
val sut = UtdTracker(fakeAnalyticsService)
|
||||||
sut.onUtd(
|
sut.onUtd(
|
||||||
UnableToDecryptInfo(
|
aRustUnableToDecryptInfo(
|
||||||
eventId = AN_EVENT_ID.value,
|
eventId = AN_EVENT_ID.value,
|
||||||
timeToDecryptMs = 123.toULong(),
|
timeToDecryptMs = 123.toULong(),
|
||||||
cause = UtdCause.UNKNOWN,
|
cause = UtdCause.UNKNOWN,
|
||||||
|
|
@ -71,7 +71,7 @@ class UtdTrackerTest {
|
||||||
val fakeAnalyticsService = FakeAnalyticsService()
|
val fakeAnalyticsService = FakeAnalyticsService()
|
||||||
val sut = UtdTracker(fakeAnalyticsService)
|
val sut = UtdTracker(fakeAnalyticsService)
|
||||||
sut.onUtd(
|
sut.onUtd(
|
||||||
UnableToDecryptInfo(
|
aRustUnableToDecryptInfo(
|
||||||
eventId = AN_EVENT_ID.value,
|
eventId = AN_EVENT_ID.value,
|
||||||
timeToDecryptMs = 123.toULong(),
|
timeToDecryptMs = 123.toULong(),
|
||||||
cause = UtdCause.SENT_BEFORE_WE_JOINED,
|
cause = UtdCause.SENT_BEFORE_WE_JOINED,
|
||||||
|
|
@ -96,7 +96,7 @@ class UtdTrackerTest {
|
||||||
val fakeAnalyticsService = FakeAnalyticsService()
|
val fakeAnalyticsService = FakeAnalyticsService()
|
||||||
val sut = UtdTracker(fakeAnalyticsService)
|
val sut = UtdTracker(fakeAnalyticsService)
|
||||||
sut.onUtd(
|
sut.onUtd(
|
||||||
UnableToDecryptInfo(
|
aRustUnableToDecryptInfo(
|
||||||
eventId = AN_EVENT_ID.value,
|
eventId = AN_EVENT_ID.value,
|
||||||
timeToDecryptMs = 123.toULong(),
|
timeToDecryptMs = 123.toULong(),
|
||||||
cause = UtdCause.UNSIGNED_DEVICE,
|
cause = UtdCause.UNSIGNED_DEVICE,
|
||||||
|
|
@ -119,7 +119,7 @@ class UtdTrackerTest {
|
||||||
val fakeAnalyticsService = FakeAnalyticsService()
|
val fakeAnalyticsService = FakeAnalyticsService()
|
||||||
val sut = UtdTracker(fakeAnalyticsService)
|
val sut = UtdTracker(fakeAnalyticsService)
|
||||||
sut.onUtd(
|
sut.onUtd(
|
||||||
UnableToDecryptInfo(
|
aRustUnableToDecryptInfo(
|
||||||
eventId = AN_EVENT_ID.value,
|
eventId = AN_EVENT_ID.value,
|
||||||
timeToDecryptMs = 123.toULong(),
|
timeToDecryptMs = 123.toULong(),
|
||||||
cause = UtdCause.VERIFICATION_VIOLATION,
|
cause = UtdCause.VERIFICATION_VIOLATION,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 New Vector Ltd.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
* Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.libraries.matrix.impl.fixtures.factories
|
||||||
|
|
||||||
|
import org.matrix.rustcomponents.sdk.UnableToDecryptInfo
|
||||||
|
import uniffi.matrix_sdk_crypto.UtdCause
|
||||||
|
|
||||||
|
internal fun aRustUnableToDecryptInfo(
|
||||||
|
eventId: String,
|
||||||
|
timeToDecryptMs: ULong?,
|
||||||
|
cause: UtdCause,
|
||||||
|
eventLocalAgeMillis: Long = 0L,
|
||||||
|
userTrustsOwnIdentity: Boolean = false,
|
||||||
|
senderHomeserver: String = "",
|
||||||
|
ownHomeserver: String = "",
|
||||||
|
): UnableToDecryptInfo {
|
||||||
|
return UnableToDecryptInfo(
|
||||||
|
eventId = eventId,
|
||||||
|
timeToDecryptMs = timeToDecryptMs,
|
||||||
|
cause = cause,
|
||||||
|
eventLocalAgeMillis = eventLocalAgeMillis,
|
||||||
|
userTrustsOwnIdentity = userTrustsOwnIdentity,
|
||||||
|
senderHomeserver = senderHomeserver,
|
||||||
|
ownHomeserver = ownHomeserver,
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue