From 1bc431198eb97187a448b2d8ff8733204c78b14e Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 16 Mar 2021 20:09:42 +0100 Subject: [PATCH 01/12] Timeline: fix ripple on text item --- .../main/res/layout/item_timeline_event_text_message_stub.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/vector/src/main/res/layout/item_timeline_event_text_message_stub.xml b/vector/src/main/res/layout/item_timeline_event_text_message_stub.xml index 7bdd0dd1e3..42cf24d027 100644 --- a/vector/src/main/res/layout/item_timeline_event_text_message_stub.xml +++ b/vector/src/main/res/layout/item_timeline_event_text_message_stub.xml @@ -3,6 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" + android:addStatesFromChildren="true" android:orientation="vertical"> Date: Tue, 16 Mar 2021 16:44:55 +0100 Subject: [PATCH 02/12] Timeline: fix separators background --- .../main/res/layout/item_timeline_event_day_separator.xml | 8 +++----- vector/src/main/res/layout/item_timeline_read_marker.xml | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/vector/src/main/res/layout/item_timeline_event_day_separator.xml b/vector/src/main/res/layout/item_timeline_event_day_separator.xml index 74cc63e5be..ca9d84f698 100644 --- a/vector/src/main/res/layout/item_timeline_event_day_separator.xml +++ b/vector/src/main/res/layout/item_timeline_event_day_separator.xml @@ -3,7 +3,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?riotx_background" android:padding="8dp"> + android:background="?riotx_list_bottom_sheet_divider_color" /> diff --git a/vector/src/main/res/layout/item_timeline_read_marker.xml b/vector/src/main/res/layout/item_timeline_read_marker.xml index e76ffa3d5c..e7471823f2 100644 --- a/vector/src/main/res/layout/item_timeline_read_marker.xml +++ b/vector/src/main/res/layout/item_timeline_read_marker.xml @@ -2,7 +2,6 @@ From 616a46294ce62c1896130a3898c36091cdf80db0 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 16 Mar 2021 20:14:20 +0100 Subject: [PATCH 03/12] Update CHANGES --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 98c7a0351a..1115f41142 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Bugfix 🐛: - Ensure message are decrypted in the room list after a clear cache - Regression: Video will not play upon tap, but only after swipe #2928 - Cross signing now works with servers with an explicit port in the servername + - Timeline : Fix ripple effect on text item and fix background color of separators. Translations 🗣: - From 5edf7ca5209e5baab6da717544cf883376912be0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 16 Mar 2021 22:09:41 +0100 Subject: [PATCH 04/12] Version++ --- CHANGES.md | 27 +++++++++++++++++++++++++++ vector/build.gradle | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 491b779582..69d793e479 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,30 @@ +Changes in Element 1.1.3 (2021-XX-XX) +=================================================== + +Features ✨: + - + +Improvements 🙌: + - + +Bugfix 🐛: + - + +Translations 🗣: + - + +SDK API changes ⚠️: + - + +Build 🧱: + - + +Test: + - + +Other changes: + - + Changes in Element 1.1.2 (2021-03-16) =================================================== diff --git a/vector/build.gradle b/vector/build.gradle index deb3bdba26..0468c68614 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -14,7 +14,7 @@ kapt { // Note: 2 digits max for each value ext.versionMajor = 1 ext.versionMinor = 1 -ext.versionPatch = 2 +ext.versionPatch = 3 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' From 1d1f78a020fbdcaa775b521cf94c4bb6200a3741 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Mar 2021 10:39:25 +0100 Subject: [PATCH 05/12] Timber.d instead of Timber.v --- .../internal/session/sync/InitialSyncStatusRepository.kt | 2 +- .../android/sdk/internal/session/sync/RoomSyncHandler.kt | 4 ++-- .../matrix/android/sdk/internal/session/sync/SyncTask.kt | 6 +++--- .../parsing/DefaultLazyRoomSyncEphemeralJsonAdapter.kt | 4 ++-- .../session/sync/parsing/InitialSyncResponseParser.kt | 4 ++-- .../java/org/matrix/android/sdk/internal/util/LogUtil.kt | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/InitialSyncStatusRepository.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/InitialSyncStatusRepository.kt index 4b82ecc3e5..cf67bbd805 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/InitialSyncStatusRepository.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/InitialSyncStatusRepository.kt @@ -65,7 +65,7 @@ internal class FileInitialSyncStatusRepository(directory: File) : InitialSyncSta val state = cache?.step ?: InitialSyncStatus.STEP_INIT return if (state >= InitialSyncStatus.STEP_DOWNLOADED && System.currentTimeMillis() > (cache?.downloadedDate ?: 0) + INIT_SYNC_FILE_LIFETIME) { - Timber.v("INIT_SYNC downloaded file is outdated, download it again") + Timber.d("INIT_SYNC downloaded file is outdated, download it again") // The downloaded file is outdated setStep(InitialSyncStatus.STEP_INIT) InitialSyncStatus.STEP_INIT diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt index a96d55d028..0f97d0cb39 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncHandler.kt @@ -147,13 +147,13 @@ internal class RoomSyncHandler @Inject constructor(private val readReceiptHandle if (numberOfChunks > 1) { reportSubtask(reporter, InitSyncStep.ImportingAccountJoinedRooms, numberOfChunks, 0.6f) { val chunkSize = listSize / numberOfChunks - Timber.v("INIT_SYNC $listSize rooms to insert, split into $numberOfChunks sublists of $chunkSize items") + Timber.d("INIT_SYNC $listSize rooms to insert, split into $numberOfChunks sublists of $chunkSize items") // I cannot find a better way to chunk a map, so chunk the keys and then create new maps handlingStrategy.data.keys .chunked(chunkSize) .forEachIndexed { index, roomIds -> val roomEntities = roomIds - .also { Timber.v("INIT_SYNC insert ${roomIds.size} rooms") } + .also { Timber.d("INIT_SYNC insert ${roomIds.size} rooms") } .map { handleJoinedRoom( realm = realm, diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt index d47ca8fa68..8d8d69be1e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt @@ -101,7 +101,7 @@ internal class DefaultSyncTask @Inject constructor( val readTimeOut = (params.timeout + TIMEOUT_MARGIN).coerceAtLeast(TimeOutInterceptor.DEFAULT_LONG_TIMEOUT) if (isInitialSync) { - Timber.v("INIT_SYNC with filter: ${requestParams["filter"]}") + Timber.d("INIT_SYNC with filter: ${requestParams["filter"]}") val initSyncStrategy = initialSyncStrategy logDuration("INIT_SYNC strategy: $initSyncStrategy") { if (initSyncStrategy is InitialSyncStrategy.Optimized) { @@ -145,7 +145,7 @@ internal class DefaultSyncTask @Inject constructor( val workingFile = File(workingDir, "initSync.json") val status = initialSyncStatusRepository.getStep() if (workingFile.exists() && status >= InitialSyncStatus.STEP_DOWNLOADED) { - Timber.v("INIT_SYNC file is already here") + Timber.d("INIT_SYNC file is already here") reportSubtask(initialSyncProgressService, InitSyncStep.Downloading, 1, 0.3f) { // Empty task } @@ -204,7 +204,7 @@ internal class DefaultSyncTask @Inject constructor( // Log some stats val nbOfJoinedRooms = syncResponse.rooms?.join?.size ?: 0 val nbOfJoinedRoomsInFile = syncResponse.rooms?.join?.values?.count { it.ephemeral is LazyRoomSyncEphemeral.Stored } - Timber.v("INIT_SYNC $nbOfJoinedRooms rooms, $nbOfJoinedRoomsInFile ephemeral stored into files") + Timber.d("INIT_SYNC $nbOfJoinedRooms rooms, $nbOfJoinedRoomsInFile ephemeral stored into files") logDuration("INIT_SYNC Database insertion") { syncResponseHandler.handleResponse(syncResponse, null, initialSyncProgressService) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/DefaultLazyRoomSyncEphemeralJsonAdapter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/DefaultLazyRoomSyncEphemeralJsonAdapter.kt index 22ac4f911d..940ea219fb 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/DefaultLazyRoomSyncEphemeralJsonAdapter.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/DefaultLazyRoomSyncEphemeralJsonAdapter.kt @@ -57,12 +57,12 @@ internal class SplitLazyRoomSyncEphemeralJsonAdapter( } val limit = syncStrategy.minSizeToStoreInFile return if (json.length > limit) { - Timber.v("INIT_SYNC $path content length: ${json.length} copy to a file") + Timber.d("INIT_SYNC $path content length: ${json.length} copy to a file") // Copy the source to a file roomSyncEphemeralTemporaryStore.write(roomId, json) LazyRoomSyncEphemeral.Stored } else { - Timber.v("INIT_SYNC $path content length: ${json.length} parse it now") + Timber.d("INIT_SYNC $path content length: ${json.length} parse it now") val roomSync = delegate.fromJson(json) ?: return null LazyRoomSyncEphemeral.Parsed(roomSync) } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/InitialSyncResponseParser.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/InitialSyncResponseParser.kt index bfa9974b77..0b44887aed 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/InitialSyncResponseParser.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/InitialSyncResponseParser.kt @@ -33,9 +33,9 @@ internal class InitialSyncResponseParser @Inject constructor( fun parse(syncStrategy: InitialSyncStrategy.Optimized, workingFile: File): SyncResponse { val syncResponseLength = workingFile.length().toInt() - Timber.v("INIT_SYNC Sync file size is $syncResponseLength bytes") + Timber.d("INIT_SYNC Sync file size is $syncResponseLength bytes") val shouldSplit = syncResponseLength >= syncStrategy.minSizeToSplit - Timber.v("INIT_SYNC should split in several files: $shouldSplit") + Timber.d("INIT_SYNC should split in several files: $shouldSplit") return getMoshi(syncStrategy, shouldSplit) .adapter(SyncResponse::class.java) .fromJson(workingFile.source().buffer())!! diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/LogUtil.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/LogUtil.kt index bfa723c160..4656856bf7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/LogUtil.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/LogUtil.kt @@ -33,13 +33,13 @@ internal fun Collection.logLimit(maxQuantity: Int = 5): String { internal suspend fun logDuration(message: String, block: suspend () -> T): T { - Timber.v("$message -- BEGIN") + Timber.d("$message -- BEGIN") val start = System.currentTimeMillis() val result = logRamUsage(message) { block() } val duration = System.currentTimeMillis() - start - Timber.v("$message -- END duration: $duration ms") + Timber.d("$message -- END duration: $duration ms") return result } @@ -50,12 +50,12 @@ internal suspend fun logRamUsage(message: String, block: suspend () -> T): T runtime.gc() val freeMemoryInMb = runtime.freeMemory() / 1048576L val usedMemInMBStart = runtime.totalMemory() / 1048576L - freeMemoryInMb - Timber.v("$message -- BEGIN (free memory: $freeMemoryInMb MB)") + Timber.d("$message -- BEGIN (free memory: $freeMemoryInMb MB)") val result = block() runtime.gc() val usedMemInMBEnd = (runtime.totalMemory() - runtime.freeMemory()) / 1048576L val usedMemInMBDiff = usedMemInMBEnd - usedMemInMBStart - Timber.v("$message -- END RAM usage: $usedMemInMBDiff MB") + Timber.d("$message -- END RAM usage: $usedMemInMBDiff MB") result } else { block() From e89e0724a092d99706f23f169004c776502896c9 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Mar 2021 11:04:17 +0100 Subject: [PATCH 06/12] limit log --- .../internal/crypto/crosssigning/DefaultCrossSigningService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt index 9b282f0a84..873c98bff7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt @@ -43,6 +43,7 @@ import org.matrix.android.sdk.internal.task.TaskThread import org.matrix.android.sdk.internal.task.configureWith import org.matrix.android.sdk.internal.util.JsonCanonicalizer import org.matrix.android.sdk.internal.util.MatrixCoroutineDispatchers +import org.matrix.android.sdk.internal.util.logLimit import org.matrix.android.sdk.internal.worker.WorkerParamsFactory import org.matrix.olm.OlmPkSigning import org.matrix.olm.OlmUtility @@ -750,7 +751,7 @@ internal class DefaultCrossSigningService @Inject constructor( } override fun onUsersDeviceUpdate(userIds: List) { - Timber.d("## CrossSigning - onUsersDeviceUpdate for ${userIds.size} users: $userIds") + Timber.d("## CrossSigning - onUsersDeviceUpdate for users: ${userIds.logLimit()}") val workerParams = UpdateTrustWorker.Params( sessionId = sessionId, filename = updateTrustWorkerDataRepository.createParam(userIds) From 174e938b5be404e25a68f1a748a67aa6c008f4e1 Mon Sep 17 00:00:00 2001 From: ganfra Date: Wed, 17 Mar 2021 11:44:22 +0100 Subject: [PATCH 07/12] Fix padding layout --- .../src/main/res/layout/item_timeline_event_day_separator.xml | 3 ++- vector/src/main/res/layout/item_timeline_read_marker.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vector/src/main/res/layout/item_timeline_event_day_separator.xml b/vector/src/main/res/layout/item_timeline_event_day_separator.xml index ca9d84f698..a721864e5b 100644 --- a/vector/src/main/res/layout/item_timeline_event_day_separator.xml +++ b/vector/src/main/res/layout/item_timeline_event_day_separator.xml @@ -19,7 +19,8 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:background="?android:attr/windowBackground" - android:paddingHorizontal="24dp" + android:paddingStart="24dp" + android:paddingEnd="24dp" android:textColor="?riotx_header_panel_text_secondary" android:textSize="15sp" tools:text="@tools:sample/date/day_of_week" /> diff --git a/vector/src/main/res/layout/item_timeline_read_marker.xml b/vector/src/main/res/layout/item_timeline_read_marker.xml index e7471823f2..5ce388c90b 100644 --- a/vector/src/main/res/layout/item_timeline_read_marker.xml +++ b/vector/src/main/res/layout/item_timeline_read_marker.xml @@ -18,7 +18,8 @@ android:layout_gravity="center" android:background="?android:attr/windowBackground" android:fontFamily="sans-serif-medium" - android:paddingHorizontal="16dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" android:text="@string/timeline_unread_messages" android:textColor="@color/notification_accent_color" android:textSize="15sp" /> From 616d3c19883ef89d65b43f76ddf815a5919b7911 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Mar 2021 12:42:28 +0100 Subject: [PATCH 08/12] Fix IllegalStateException in UpdateTrustWorker Also split into 2 methods --- .../crypto/crosssigning/UpdateTrustWorker.kt | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt index ad82c03913..76b63b7798 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt @@ -97,22 +97,17 @@ internal class UpdateTrustWorker(context: Context, // Unfortunately we don't have much info on what did exactly changed (is it the cross signing keys of that user, // or a new device?) So we check all again :/ Timber.d("## CrossSigning - Updating trust for users: ${userList.logLimit()}") - - Realm.getInstance(cryptoRealmConfiguration).use { cryptoRealm -> - Realm.getInstance(sessionRealmConfiguration).use { - updateTrust(userList, cryptoRealm) - } - } + updateTrust(userList) } cleanup(params) return Result.success() } - private suspend fun updateTrust(userListParam: List, - cRealm: Realm) { + private suspend fun updateTrust(userListParam: List) { var userList = userListParam var myCrossSigningInfo: MXCrossSigningInfo? = null + // First we check that the users MSK are trusted by mine // After that we check the trust chain for each devices of each users awaitTransaction(cryptoRealmConfiguration) { cryptoRealm -> @@ -203,38 +198,43 @@ internal class UpdateTrustWorker(context: Context, // So Cross Signing keys trust is updated, device trust is updated // We can now update room shields? in the session DB? + updateTrustStep2(userList, myCrossSigningInfo) + } + private suspend fun updateTrustStep2(userList: List, myCrossSigningInfo: MXCrossSigningInfo?) { Timber.d("## CrossSigning - Updating shields for impacted rooms...") awaitTransaction(sessionRealmConfiguration) { sessionRealm -> - sessionRealm.where(RoomMemberSummaryEntity::class.java) - .`in`(RoomMemberSummaryEntityFields.USER_ID, userList.toTypedArray()) - .distinct(RoomMemberSummaryEntityFields.ROOM_ID) - .findAll() - .map { it.roomId } - .also { Timber.d("## CrossSigning - ... impacted rooms ${it.logLimit()}") } - .forEach { roomId -> - RoomSummaryEntity.where(sessionRealm, roomId) - .equalTo(RoomSummaryEntityFields.IS_ENCRYPTED, true) - .findFirst() - ?.let { roomSummary -> - Timber.d("## CrossSigning - Check shield state for room $roomId") - val allActiveRoomMembers = RoomMemberHelper(sessionRealm, roomId).getActiveRoomMemberIds() - try { - val updatedTrust = computeRoomShield( - myCrossSigningInfo, - cRealm, - allActiveRoomMembers, - roomSummary - ) - if (roomSummary.roomEncryptionTrustLevel != updatedTrust) { - Timber.d("## CrossSigning - Shield change detected for $roomId -> $updatedTrust") - roomSummary.roomEncryptionTrustLevel = updatedTrust + Realm.getInstance(cryptoRealmConfiguration).use { cryptoRealm -> + sessionRealm.where(RoomMemberSummaryEntity::class.java) + .`in`(RoomMemberSummaryEntityFields.USER_ID, userList.toTypedArray()) + .distinct(RoomMemberSummaryEntityFields.ROOM_ID) + .findAll() + .map { it.roomId } + .also { Timber.d("## CrossSigning - ... impacted rooms ${it.logLimit()}") } + .forEach { roomId -> + RoomSummaryEntity.where(sessionRealm, roomId) + .equalTo(RoomSummaryEntityFields.IS_ENCRYPTED, true) + .findFirst() + ?.let { roomSummary -> + Timber.d("## CrossSigning - Check shield state for room $roomId") + val allActiveRoomMembers = RoomMemberHelper(sessionRealm, roomId).getActiveRoomMemberIds() + try { + val updatedTrust = computeRoomShield( + myCrossSigningInfo, + cryptoRealm, + allActiveRoomMembers, + roomSummary + ) + if (roomSummary.roomEncryptionTrustLevel != updatedTrust) { + Timber.d("## CrossSigning - Shield change detected for $roomId -> $updatedTrust") + roomSummary.roomEncryptionTrustLevel = updatedTrust + } + } catch (failure: Throwable) { + Timber.e(failure) } - } catch (failure: Throwable) { - Timber.e(failure) } - } - } + } + } } } From a4f6fe0cd2115dc54e46cb26fbd30d21231c1454 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Mar 2021 12:43:05 +0100 Subject: [PATCH 09/12] Cleanup --- .../internal/crypto/store/db/mapper/CrossSigningKeysMapper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/mapper/CrossSigningKeysMapper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/mapper/CrossSigningKeysMapper.kt index 8e6143f301..9e73985592 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/mapper/CrossSigningKeysMapper.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/mapper/CrossSigningKeysMapper.kt @@ -45,7 +45,7 @@ internal class CrossSigningKeysMapper @Inject constructor(moshi: Moshi) { return CryptoCrossSigningKey( userId = userId ?: "", keys = mapOf("ed25519:$pubKey" to pubKey), - usages = keyInfo.usages.map { it }, + usages = keyInfo.usages.toList(), signatures = deserializeSignatures(keyInfo.signatures), trustLevel = keyInfo.trustLevelEntity?.let { DeviceTrustLevel( From 192fc6fd9434ca695b05ede0fc6a273c9034ef96 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Mar 2021 14:54:15 +0100 Subject: [PATCH 10/12] Use minimum delay accepted by the Work library. The current value is 10_000 and smaller value will be ignored. It will remove the warning "W/WM-WorkSpec: Backoff delay duration less than minimum value" --- .../android/sdk/internal/crypto/GossipingWorkManager.kt | 2 +- .../crypto/crosssigning/DefaultCrossSigningService.kt | 2 +- .../crypto/verification/VerificationTransportRoomMessage.kt | 4 ++-- .../org/matrix/android/sdk/internal/di/WorkManagerProvider.kt | 4 +++- .../sdk/internal/session/pushers/DefaultPushersService.kt | 2 +- .../sdk/internal/session/room/send/DefaultSendService.kt | 4 ++-- .../session/room/timeline/TimelineSendEventWorkCommon.kt | 3 +-- .../android/sdk/internal/session/sync/job/SyncWorker.kt | 4 ++-- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/GossipingWorkManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/GossipingWorkManager.kt index c9451aa002..0013c31eea 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/GossipingWorkManager.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/GossipingWorkManager.kt @@ -39,7 +39,7 @@ internal class GossipingWorkManager @Inject constructor( .setConstraints(WorkManagerProvider.workConstraints) .startChain(startChain) .setInputData(data) - .setBackoffCriteria(BackoffPolicy.LINEAR, 10_000L, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt index 873c98bff7..0289fadbd8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt @@ -760,7 +760,7 @@ internal class DefaultCrossSigningService @Inject constructor( val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder() .setInputData(workerData) - .setBackoffCriteria(BackoffPolicy.LINEAR, 2_000L, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() workManagerProvider.workManager diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransportRoomMessage.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransportRoomMessage.kt index ad490bcd27..bcf3250ed2 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransportRoomMessage.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransportRoomMessage.kt @@ -183,7 +183,7 @@ internal class VerificationTransportRoomMessage( val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder() .setConstraints(WorkManagerProvider.workConstraints) .setInputData(workerParams) - .setBackoffCriteria(BackoffPolicy.LINEAR, 2_000L, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() workManagerProvider.workManager @@ -280,7 +280,7 @@ internal class VerificationTransportRoomMessage( val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder() .setConstraints(WorkManagerProvider.workConstraints) .setInputData(workerParams) - .setBackoffCriteria(BackoffPolicy.LINEAR, 2_000L, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() return workManagerProvider.workManager .beginUniqueWork(uniqueQueueName(), ExistingWorkPolicy.APPEND_OR_REPLACE, workRequest) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/WorkManagerProvider.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/WorkManagerProvider.kt index 4c9d06f7a2..bafffdf852 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/WorkManagerProvider.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/WorkManagerProvider.kt @@ -23,6 +23,7 @@ import androidx.work.NetworkType import androidx.work.OneTimeWorkRequestBuilder import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager +import androidx.work.WorkRequest import java.util.concurrent.TimeUnit import javax.inject.Inject @@ -69,6 +70,7 @@ internal class WorkManagerProvider @Inject constructor( .setRequiredNetworkType(NetworkType.CONNECTED) .build() - const val BACKOFF_DELAY = 10_000L + // Use min value, smaller value will be ignored + const val BACKOFF_DELAY_MILLIS = WorkRequest.MIN_BACKOFF_MILLIS } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt index e239182b4a..d290bb1a03 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt @@ -96,7 +96,7 @@ internal class DefaultPushersService @Inject constructor( val request = workManagerProvider.matrixOneTimeWorkRequestBuilder() .setConstraints(WorkManagerProvider.workConstraints) .setInputData(WorkerParamsFactory.toData(params)) - .setBackoffCriteria(BackoffPolicy.LINEAR, 10_000L, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() workManagerProvider.workManager.enqueue(request) return request.id diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt index c5b8b42b3c..26a87557ff 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/DefaultSendService.kt @@ -318,7 +318,7 @@ internal class DefaultSendService @AssistedInject constructor( .setConstraints(WorkManagerProvider.workConstraints) .startChain(true) .setInputData(uploadWorkData) - .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() } @@ -332,7 +332,7 @@ internal class DefaultSendService @AssistedInject constructor( // .setConstraints(WorkManagerProvider.workConstraints) .startChain(false) .setInputData(workData) - .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineSendEventWorkCommon.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineSendEventWorkCommon.kt index bfd4e22cc2..21b508d35a 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineSendEventWorkCommon.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/TimelineSendEventWorkCommon.kt @@ -50,7 +50,7 @@ internal class TimelineSendEventWorkCommon @Inject constructor( .setConstraints(WorkManagerProvider.workConstraints) .startChain(startChain) .setInputData(data) - .setBackoffCriteria(BackoffPolicy.LINEAR, BACKOFF_DELAY, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .build() } @@ -60,6 +60,5 @@ internal class TimelineSendEventWorkCommon @Inject constructor( companion object { private const val SEND_WORK = "SEND_WORK" - private const val BACKOFF_DELAY = 10_000L } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncWorker.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncWorker.kt index 211b643516..b81804feb5 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncWorker.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncWorker.kt @@ -106,7 +106,7 @@ internal class SyncWorker(context: Context, val data = WorkerParamsFactory.toData(Params(sessionId, serverTimeout, 0L, false)) val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder() .setConstraints(WorkManagerProvider.workConstraints) - .setBackoffCriteria(BackoffPolicy.LINEAR, 1_000, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .setInputData(data) .build() workManagerProvider.workManager @@ -118,7 +118,7 @@ internal class SyncWorker(context: Context, val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder() .setConstraints(WorkManagerProvider.workConstraints) .setInputData(data) - .setBackoffCriteria(BackoffPolicy.LINEAR, 1_000, TimeUnit.MILLISECONDS) + .setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS) .setInitialDelay(delayInSeconds, TimeUnit.SECONDS) .build() From 67ff43cecc5293a5a83784c6f712eec4a725c004 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Mar 2021 15:04:39 +0100 Subject: [PATCH 11/12] Changelog --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 69d793e479..9006236088 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ Improvements 🙌: - Bugfix 🐛: - - + - Fix regression in UpdateTrustWorker (introduced in 1.1.2) Translations 🗣: - From 1eda7fa5bb11cecb832d06cf238e407bb4b0648b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Mar 2021 10:35:03 +0100 Subject: [PATCH 12/12] Prepare release 1.1.3 --- CHANGES.md | 27 +++---------------- .../android/en-US/changelogs/40101030.txt | 2 ++ 2 files changed, 5 insertions(+), 24 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/40101030.txt diff --git a/CHANGES.md b/CHANGES.md index aa94c67be7..d410a5033d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,32 +1,11 @@ -Changes in Element 1.1.3 (2021-XX-XX) +Changes in Element 1.1.3 (2021-03-18) =================================================== -Features ✨: - - - -Improvements 🙌: - - - Bugfix 🐛: - Fix regression in UpdateTrustWorker (introduced in 1.1.2) - Timeline : Fix ripple effect on text item and fix background color of separators. -Translations 🗣: - - - -SDK API changes ⚠️: - - - -Build 🧱: - - - -Test: - - - -Other changes: - - - -Changes in Element 1.1.2 (2021-03-16) +Changes in Element 1.1.2 (2021-03-16) (was not published tp GPlay prod) =================================================== Improvements 🙌: @@ -42,7 +21,7 @@ Bugfix 🐛: Other changes: - Change formatting on issue templates to proper headings. -Changes in Element 1.1.1 (2021-03-10) +Changes in Element 1.1.1 (2021-03-10) (was not published tp GPlay prod) =================================================== Improvements 🙌: diff --git a/fastlane/metadata/android/en-US/changelogs/40101030.txt b/fastlane/metadata/android/en-US/changelogs/40101030.txt new file mode 100644 index 0000000000..22d116fbfe --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/40101030.txt @@ -0,0 +1,2 @@ +Main changes in this version: performance improvement and bug fixes! +Full changelog: https://github.com/vector-im/element-android/releases/tag/v1.1.3 \ No newline at end of file