Add Konsist test to check that toPersistentList() is not used.

Same for `toPersistentSet()` and `toPersistentMap()`.
Fix existing issues.
This commit is contained in:
Benoit Marty 2025-10-08 14:25:15 +02:00
parent 2fa1b9d448
commit 67c9daa0bf
85 changed files with 305 additions and 254 deletions

View file

@ -12,7 +12,7 @@ import io.element.android.libraries.matrix.api.room.RoomMember
import io.element.android.libraries.matrix.api.room.RoomMembersState
import io.element.android.libraries.matrix.api.room.activeRoomMembers
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toPersistentList
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
@ -38,7 +38,7 @@ fun BaseRoom.usersWithRole(role: RoomMember.Role): Flow<ImmutableList<RoomMember
.combine(readyMembersFlow) { powerLevels, membersState ->
membersState.activeRoomMembers()
.filter { powerLevels.contains(it.userId) }
.toPersistentList()
.toImmutableList()
}
.distinctUntilChanged()
}