fix: call nativeStartSignaling from Java Thread with 8MB stack, not Kotlin IO dispatcher
Some checks failed
Mirror to GitHub / mirror (push) Failing after 38s
Build Release Binaries / build-amd64 (push) Failing after 3m32s

This commit is contained in:
Siavash Sameni
2026-04-09 08:10:22 +04:00
parent faec332a8c
commit 0b821585ab

View File

@@ -171,16 +171,20 @@ class CallViewModel : ViewModel(), WzpCallback {
val seed = _seedHex.value val seed = _seedHex.value
val alias = _alias.value val alias = _alias.value
viewModelScope.launch(Dispatchers.IO) { // Use a Java Thread with 8MB stack — Kotlin's IO dispatcher threads are too small
val resolvedRelay = resolveToIp(relay) ?: relay // for the native JNI + Rust + TLS stack requirements
val resolvedRelay = resolveToIp(relay) ?: relay
Thread(null, {
val result = engine?.startSignaling(resolvedRelay, seed, "", alias) val result = engine?.startSignaling(resolvedRelay, seed, "", alias)
if (result == 0) { viewModelScope.launch {
_signalState.value = 5 // Registered if (result == 0) {
startStatsPolling() _signalState.value = 5 // Registered
} else { startStatsPolling()
_errorMessage.value = "Failed to register on relay" } else {
_errorMessage.value = "Failed to register on relay"
}
} }
} }, "wzp-register", 8 * 1024 * 1024).start()
} }
/** Place a direct call to the target fingerprint */ /** Place a direct call to the target fingerprint */