Solves some of the crashes of concurrent modification exception

This commit is contained in:
Vitor Pamplona
2026-03-23 17:59:14 -04:00
parent f553489ddf
commit e5aeb49a4b
@@ -36,7 +36,7 @@ class RelayOfflineTracker(
const val TAG = "RelayOfflineTracker"
}
val cannotConnectRelays = mutableSetOf<NormalizedRelayUrl>()
var cannotConnectRelays = setOf<NormalizedRelayUrl>()
private val clientListener =
object : IRelayClientListener {
@@ -45,14 +45,14 @@ class RelayOfflineTracker(
pingMillis: Int,
compressed: Boolean,
) {
cannotConnectRelays.remove(relay.url)
cannotConnectRelays -= relay.url
}
override fun onCannotConnect(
relay: IRelayClient,
errorMessage: String,
) {
cannotConnectRelays.add(relay.url)
cannotConnectRelays += relay.url
}
}