Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore DecryptionFailureTracker to fix the crash on Android 5 and 6 #1089

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1088.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correction du crash au lancement de l'application sur Android 5 et 6.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class DecryptionFailureTracker @Inject constructor(
fun stop() {
Timber.v("Stop DecryptionFailureTracker")
post {
decryptionFailurePersistence.persist()
decryptionFailurePersistence.persist()
}
activeSessionSourceDisposable.cancel(CancellationException("Closing DecryptionFailureTracker"))

Expand Down Expand Up @@ -136,8 +136,9 @@ class DecryptionFailureTracker @Inject constructor(
}
}
}

private fun observeActiveSession() {
activeSessionSourceDisposable = sessionDataSource.stream()
activeSessionSourceDisposable = sessionDataSource.stream()
.distinctUntilChanged()
.onEach {
Timber.v("Active session changed ${it.getOrNull()?.myUserId}")
Expand Down Expand Up @@ -213,7 +214,7 @@ class DecryptionFailureTracker @Inject constructor(
}
val isOwnIdentityTrusted = session.cryptoService().crossSigningService().isCrossSigningVerified()
val userHS = MatrixPatterns.extractServerNameFromId(session.myUserId)
val messageSenderHs = event.senderId?.let { MatrixPatterns.extractServerNameFromId(it) }
val messageSenderHs = event.senderId?.let { MatrixPatterns.extractServerNameFromId(it) }
Timber.v("senderHs: $messageSenderHs, userHS: $userHS, isOwnIdentityTrusted: $isOwnIdentityTrusted")

val deviceCreationTs = session.cryptoService().getMyCryptoDevice().firstTimeSeenLocalTs
Expand Down Expand Up @@ -264,7 +265,7 @@ class DecryptionFailureTracker @Inject constructor(
}
}

fun utdDisplayedInTimeline(event: TimelineEvent) {
fun utdDisplayedInTimeline(event: TimelineEvent) {
post {
// should be tracked (unless already reported)
val eventId = event.root.eventId ?: return@post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package im.vector.app.features.analytics

import android.content.Context
import android.util.LruCache
import com.google.common.hash.BloomFilter
import com.google.common.hash.Funnels
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.checkerframework.com.google.common.hash.BloomFilter
import org.checkerframework.com.google.common.hash.Funnels
import timber.log.Timber
import java.io.File
import java.io.FileOutputStream
Expand Down
Loading