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