fix(android): preserve disconnected node gateway status (#129839)

This commit is contained in:
Peter Steinberger
2026-08-25 23:45:27 -07:00
committed by GitHub
parent 0229fe7a2a
commit fc64c5704a
2 changed files with 17 additions and 1 deletions
@@ -2160,7 +2160,7 @@ internal fun gatewaySummary(
isConnected: Boolean,
gatewayConnectionProblem: GatewayConnectionProblem? = null,
): String {
if (isConnected) return nativeString("Online and ready")
if (isConnected) return if (statusText == "Connected (node offline)") gatewayStatusForDisplay(statusText) else nativeString("Online and ready")
val status = statusText.trim().lowercase()
return when {
status.contains("connecting") || status.contains("reconnecting") -> nativeString("Connecting...")
@@ -13,6 +13,7 @@ import ai.openclaw.app.GatewayPendingDeviceSummary
import ai.openclaw.app.GatewaySkillWorkshopProposal
import ai.openclaw.app.GatewaySkillWorkshopSummary
import ai.openclaw.app.chat.ChatSessionEntry
import ai.openclaw.app.gatewayConnectionDisplay
import ai.openclaw.app.i18n.resolveNativeText
import ai.openclaw.app.i18n.verbatimText
import ai.openclaw.app.normalizeOperatorScopes
@@ -842,6 +843,21 @@ class ShellScreenLogicTest {
assertEquals("Authentication needed", gatewaySummary("auth failed", isConnected = false, gatewayConnectionProblem = authProblem("SOME_UNMAPPED_CODE")))
}
@Test
fun gatewaySummaryPreservesNodeFailureWhileOperatorStaysConnected() {
val display =
gatewayConnectionDisplay(
operatorConnected = true,
nodeConnected = false,
operatorStatusText = "Connected",
nodeStatusText = "Gateway error: pairing required",
operatorProblem = null,
nodeProblem = authProblem("PAIRING_REQUIRED"),
)
assertEquals("Connected (node offline)", gatewaySummary(display))
}
@Test
fun gatewaySummaryLeavesUnrelatedStatesUnaffectedByConnectionProblem() {
val problem = authProblem("AUTH_TOKEN_MISSING")