mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Fix unhandled crashes when network is not reacheable.
This commit is contained in:
parent
2a5df54ae4
commit
8433e222ad
@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.session.sync.handler
|
||||
import androidx.work.BackoffPolicy
|
||||
import androidx.work.ExistingWorkPolicy
|
||||
import org.matrix.android.sdk.api.MatrixPatterns
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.internal.crypto.crosssigning.UpdateTrustWorker
|
||||
import org.matrix.android.sdk.internal.crypto.crosssigning.UpdateTrustWorkerDataRepository
|
||||
import org.matrix.android.sdk.internal.di.SessionId
|
||||
@ -81,9 +82,11 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
|
||||
}
|
||||
}
|
||||
if (hasUpdate) {
|
||||
tryOrNull("Unable to update user account data") {
|
||||
updateUserAccountDataTask.execute(UpdateUserAccountDataTask.DirectChatParams(directMessages = directChats))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun fetchAndUpdateUsers(userIdsToFetch: Collection<String>) {
|
||||
if (userIdsToFetch.isEmpty()) return
|
||||
|
@ -20,6 +20,7 @@ import com.zhuinden.monarchy.Monarchy
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmList
|
||||
import io.realm.kotlin.where
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.failure.GlobalError
|
||||
import org.matrix.android.sdk.api.failure.InitialSyncRequestReason
|
||||
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
|
||||
@ -122,7 +123,7 @@ internal class UserAccountDataSyncHandler @Inject constructor(
|
||||
val updateUserAccountParams = UpdateUserAccountDataTask.DirectChatParams(
|
||||
directMessages = directChats
|
||||
)
|
||||
updateUserAccountDataTask.execute(updateUserAccountParams)
|
||||
tryOrNull("Unable to update user account data") { updateUserAccountDataTask.execute(updateUserAccountParams) }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user