Merge tag 'v1.1.6' into sc

Change-Id: I80d2ce9bdcb22c2fcc9795d3a5c727cb5ba772a6
This commit is contained in:
SpiritCroc 2021-04-16 15:32:18 +02:00
commit 2ae0fb8886
7 changed files with 47 additions and 38 deletions

View File

@ -1,4 +1,11 @@
Changes in Element 1.1.5 (2021-XX-XX) Changes in Element 1.1.6 (2021-04-16)
===================================================
Bugfix 🐛:
- Fix crash on the timeline
- App crashes on "troubleshoot notifications" button (#3187)
Changes in Element 1.1.5 (2021-04-15)
=================================================== ===================================================
Bugfix 🐛: Bugfix 🐛:

View File

@ -0,0 +1,2 @@
Main changes in this version: hot fixes for 1.1.5
Full changelog: https://github.com/vector-im/element-android/releases/tag/v1.1.6

View File

@ -14,7 +14,7 @@ kapt {
// Note: 2 digits max for each value // Note: 2 digits max for each value
ext.versionMajor = 1 ext.versionMajor = 1
ext.versionMinor = 1 ext.versionMinor = 1
ext.versionPatch = 5 ext.versionPatch = 6
ext.scVersion = 30 ext.scVersion = 30

View File

@ -24,9 +24,11 @@ import im.vector.app.core.pushers.PushersManager
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.features.settings.troubleshoot.TroubleshootTest import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import im.vector.app.push.fcm.FcmHelper import im.vector.app.push.fcm.FcmHelper
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.matrix.android.sdk.api.session.pushers.PushGatewayFailure import org.matrix.android.sdk.api.session.pushers.PushGatewayFailure
import javax.inject.Inject import javax.inject.Inject
@ -47,7 +49,10 @@ class TestPushFromPushGateway @Inject constructor(private val context: AppCompat
return return
} }
action = GlobalScope.launch { action = GlobalScope.launch {
status = runCatching { pushersManager.testPush(fcmToken) } val result = runCatching { pushersManager.testPush(fcmToken) }
withContext(Dispatchers.Main) {
status = result
.fold( .fold(
{ {
// Wait for the push to be received // Wait for the push to be received
@ -65,6 +70,7 @@ class TestPushFromPushGateway @Inject constructor(private val context: AppCompat
) )
} }
} }
}
override fun onPushReceived() { override fun onPushReceived() {
description = stringProvider.getString(R.string.settings_troubleshoot_test_push_loop_success) description = stringProvider.getString(R.string.settings_troubleshoot_test_push_loop_success)

View File

@ -178,10 +178,7 @@ class RoomDetailViewModel @AssistedInject constructor(
updateShowDialerOptionState() updateShowDialerOptionState()
room.getRoomSummaryLive() room.getRoomSummaryLive()
viewModelScope.launch { viewModelScope.launch {
try { tryOrNull { room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT) }
room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT)
} catch (_: Exception) {
}
} }
// Inform the SDK that the room is displayed // Inform the SDK that the room is displayed
session.onRoomDisplayed(initialState.roomId) session.onRoomDisplayed(initialState.roomId)
@ -546,10 +543,7 @@ class RoomDetailViewModel @AssistedInject constructor(
if (trackUnreadMessages.getAndSet(false)) { if (trackUnreadMessages.getAndSet(false)) {
mostRecentDisplayedEvent?.root?.eventId?.also { mostRecentDisplayedEvent?.root?.eventId?.also {
viewModelScope.launch { viewModelScope.launch {
try { tryOrNull { room.setReadMarker(it) }
room.setReadMarker(it)
} catch (_: Exception) {
}
} }
} }
mostRecentDisplayedEvent = null mostRecentDisplayedEvent = null
@ -1256,7 +1250,7 @@ class RoomDetailViewModel @AssistedInject constructor(
} }
bufferedMostRecentDisplayedEvent.root.eventId?.let { eventId -> bufferedMostRecentDisplayedEvent.root.eventId?.let { eventId ->
viewModelScope.launch { viewModelScope.launch {
room.setReadReceipt(eventId) tryOrNull { room.setReadReceipt(eventId) }
} }
} }
}) })
@ -1265,10 +1259,7 @@ class RoomDetailViewModel @AssistedInject constructor(
private fun handleMarkAllAsRead() { private fun handleMarkAllAsRead() {
viewModelScope.launch { viewModelScope.launch {
try { tryOrNull { room.markAsRead(ReadService.MarkAsReadParams.BOTH) }
room.markAsRead(ReadService.MarkAsReadParams.BOTH)
} catch (_: Exception) {
}
} }
} }

View File

@ -25,6 +25,7 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.extensions.vectorComponent import im.vector.app.core.extensions.vectorComponent
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.room.Room import org.matrix.android.sdk.api.session.room.Room
import org.matrix.android.sdk.api.session.room.read.ReadService import org.matrix.android.sdk.api.session.room.read.ReadService
@ -78,7 +79,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
val room = session.getRoom(roomId) val room = session.getRoom(roomId)
if (room != null) { if (room != null) {
GlobalScope.launch { GlobalScope.launch {
room.join() tryOrNull { room.join() }
} }
} }
} }
@ -89,7 +90,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
val room = session.getRoom(roomId) val room = session.getRoom(roomId)
if (room != null) { if (room != null) {
GlobalScope.launch { GlobalScope.launch {
room.leave() tryOrNull { room.leave() }
} }
} }
} }
@ -100,10 +101,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
val room = session.getRoom(roomId) val room = session.getRoom(roomId)
if (room != null) { if (room != null) {
GlobalScope.launch { GlobalScope.launch {
try { tryOrNull { room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT) }
room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT)
} catch (_: Exception) {
}
} }
} }
} }

View File

@ -20,8 +20,11 @@ import androidx.activity.result.ActivityResultLauncher
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.pushrules.RuleIds import org.matrix.android.sdk.api.pushrules.RuleIds
import org.matrix.android.sdk.api.pushrules.RuleKind import org.matrix.android.sdk.api.pushrules.RuleKind
import javax.inject.Inject import javax.inject.Inject
@ -50,13 +53,15 @@ class TestAccountSettings @Inject constructor(private val stringProvider: String
if (manager?.diagStatus == TestStatus.RUNNING) return // wait before all is finished if (manager?.diagStatus == TestStatus.RUNNING) return // wait before all is finished
GlobalScope.launch { GlobalScope.launch {
runCatching { tryOrNull {
session.updatePushRuleEnableStatus(RuleKind.OVERRIDE, defaultRule, !defaultRule.enabled) session.updatePushRuleEnableStatus(RuleKind.OVERRIDE, defaultRule, !defaultRule.enabled)
} }
withContext(Dispatchers.Main) {
manager?.retry(activityResultLauncher) manager?.retry(activityResultLauncher)
} }
} }
} }
}
status = TestStatus.FAILED status = TestStatus.FAILED
} }
} else { } else {