From f45b559e83a6f1c2a37c6fc151b6080360f230f8 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Fri, 3 May 2024 01:33:38 +0200 Subject: [PATCH] fix: crash loop when logout/login while there is an MLS call ongoing (#2722) --- .../kotlin/com/wire/kalium/logic/data/call/CallRepository.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt index d1766ec90d9..52ca28b5867 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt @@ -19,6 +19,7 @@ package com.wire.kalium.logic.data.call +import co.touchlab.stately.collections.ConcurrentMutableMap import com.benasher44.uuid.uuid4 import com.wire.kalium.logger.KaliumLogLevel import com.wire.kalium.logger.obfuscateDomain @@ -155,8 +156,8 @@ internal class CallDataSource( private val job = SupervisorJob() // TODO(calling): clear job method private val scope = CoroutineScope(job + kaliumDispatchers.io) - private val callJobs = mutableMapOf() - private val staleParticipantJobs = mutableMapOf() + private val callJobs = ConcurrentMutableMap() + private val staleParticipantJobs = ConcurrentMutableMap() override suspend fun getCallConfigResponse(limit: Int?): Either = wrapApiRequest { callApi.getCallConfig(limit = limit)