mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Merge pull request #3515 from element-hq/feature/bma/fixRageshakeCrash
Fix crash when session is deleted on another client
This commit is contained in:
+5
-1
@@ -39,6 +39,7 @@ import io.element.android.features.roomlist.impl.search.RoomListSearchEvents
|
|||||||
import io.element.android.features.roomlist.impl.search.RoomListSearchState
|
import io.element.android.features.roomlist.impl.search.RoomListSearchState
|
||||||
import io.element.android.libraries.architecture.AsyncData
|
import io.element.android.libraries.architecture.AsyncData
|
||||||
import io.element.android.libraries.architecture.Presenter
|
import io.element.android.libraries.architecture.Presenter
|
||||||
|
import io.element.android.libraries.core.bool.orFalse
|
||||||
import io.element.android.libraries.designsystem.utils.snackbar.SnackbarDispatcher
|
import io.element.android.libraries.designsystem.utils.snackbar.SnackbarDispatcher
|
||||||
import io.element.android.libraries.designsystem.utils.snackbar.collectSnackbarMessageAsState
|
import io.element.android.libraries.designsystem.utils.snackbar.collectSnackbarMessageAsState
|
||||||
import io.element.android.libraries.featureflag.api.FeatureFlagService
|
import io.element.android.libraries.featureflag.api.FeatureFlagService
|
||||||
@@ -218,7 +219,10 @@ class RoomListPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val needsSlidingSyncMigration by produceState(false) {
|
val needsSlidingSyncMigration by produceState(false) {
|
||||||
value = client.isNativeSlidingSyncSupported() && !client.isUsingNativeSlidingSync()
|
value = runCatching {
|
||||||
|
// Note: this can fail when the session is destroyed from another client.
|
||||||
|
client.isNativeSlidingSyncSupported() && !client.isUsingNativeSlidingSync()
|
||||||
|
}.getOrNull().orFalse()
|
||||||
}
|
}
|
||||||
return when {
|
return when {
|
||||||
showEmpty -> RoomListContentState.Empty
|
showEmpty -> RoomListContentState.Empty
|
||||||
|
|||||||
+5
@@ -34,6 +34,11 @@ internal class FormattedJsonHttpLogger(
|
|||||||
// It can be only the case if we log the bodies of Http requests.
|
// It can be only the case if we log the bodies of Http requests.
|
||||||
if (level != HttpLoggingInterceptor.Level.BODY) return
|
if (level != HttpLoggingInterceptor.Level.BODY) return
|
||||||
|
|
||||||
|
if (message.length > 100_000) {
|
||||||
|
Timber.d("Content is too long (${message.length} chars) to be formatted as JSON")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (message.startsWith("{")) {
|
if (message.startsWith("{")) {
|
||||||
// JSON Detected
|
// JSON Detected
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user