Fix the native build: toSortedMap is java.util

commonMain, so it compiled on JVM and broke every native target. Sorted
into a LinkedHashMap instead, which is the same output everywhere.

Found by CI on iosSimulatorArm64 because I had only compiled the JVM
target locally; all five now build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-07-31 22:31:39 -04:00
co-authored by Claude Opus 5
parent 5c24b003e7
commit cf75272202
@@ -269,7 +269,15 @@ class RelayObserver : RelayConnectionListener {
return mapOf(
"auth_challenges" to authChallenges.snapshot().values.sum(),
"auth_required_relays" to authChallenges.size(),
"closed_by_reason" to closedByReason.snapshot().toSortedMap(),
// Sorted into a LinkedHashMap rather than toSortedMap(): that one is
// java.util and this file is commonMain, so it built on JVM and broke
// the native targets.
"closed_by_reason" to
closedByReason
.snapshot()
.entries
.sortedBy { it.key }
.associate { it.key to it.value },
"notices" to notices.values.sum(),
"notice_top" to
notices.entries