Improve fetch members performance, relax regexes for validating ids (#964)

* Fetched `RoomMembers` are mapped in parallel

* Add horizontal padding to room/user name in room details screen

* Relax User & Event id regex matches

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2023-07-26 16:31:26 +02:00 committed by GitHub
parent 05f7037939
commit dbec1a0a60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 79 additions and 62 deletions

View file

@ -18,6 +18,7 @@ package io.element.android.libraries.matrix.impl.room
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.core.coroutine.childScope
import io.element.android.libraries.core.coroutine.parallelMap
import io.element.android.libraries.matrix.api.core.EventId
import io.element.android.libraries.matrix.api.core.ProgressCallback
import io.element.android.libraries.matrix.api.core.RoomId
@ -168,7 +169,7 @@ class RustMatrixRoom(
val currentMembers = currentState.roomMembers()
_membersStateFlow.value = MatrixRoomMembersState.Pending(prevRoomMembers = currentMembers)
runCatching {
innerRoom.members().map(RoomMemberMapper::map)
innerRoom.members().parallelMap(RoomMemberMapper::map)
}.map {
_membersStateFlow.value = MatrixRoomMembersState.Ready(it)
}.onFailure {