Skip to content

Commit fc64c57

Browse files
authored
fix(android): preserve disconnected node gateway status (#129839)
1 parent 0229fe7 commit fc64c57

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎apps/android/app/src/main/java/ai/openclaw/app/ui/ShellScreen.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ internal fun gatewaySummary(
21602160
isConnected: Boolean,
21612161
gatewayConnectionProblem: GatewayConnectionProblem? = null,
21622162
): String {
2163-
if (isConnected) return nativeString("Online and ready")
2163+
if (isConnected) return if (statusText == "Connected (node offline)") gatewayStatusForDisplay(statusText) else nativeString("Online and ready")
21642164
val status = statusText.trim().lowercase()
21652165
return when {
21662166
status.contains("connecting") || status.contains("reconnecting") -> nativeString("Connecting...")

‎apps/android/app/src/test/java/ai/openclaw/app/ui/ShellScreenLogicTest.kt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ai.openclaw.app.GatewayPendingDeviceSummary
1313
import ai.openclaw.app.GatewaySkillWorkshopProposal
1414
import ai.openclaw.app.GatewaySkillWorkshopSummary
1515
import ai.openclaw.app.chat.ChatSessionEntry
16+
import ai.openclaw.app.gatewayConnectionDisplay
1617
import ai.openclaw.app.i18n.resolveNativeText
1718
import ai.openclaw.app.i18n.verbatimText
1819
import ai.openclaw.app.normalizeOperatorScopes
@@ -842,6 +843,21 @@ class ShellScreenLogicTest {
842843
assertEquals("Authentication needed", gatewaySummary("auth failed", isConnected = false, gatewayConnectionProblem = authProblem("SOME_UNMAPPED_CODE")))
843844
}
844845

846+
@Test
847+
fun gatewaySummaryPreservesNodeFailureWhileOperatorStaysConnected() {
848+
val display =
849+
gatewayConnectionDisplay(
850+
operatorConnected = true,
851+
nodeConnected = false,
852+
operatorStatusText = "Connected",
853+
nodeStatusText = "Gateway error: pairing required",
854+
operatorProblem = null,
855+
nodeProblem = authProblem("PAIRING_REQUIRED"),
856+
)
857+
858+
assertEquals("Connected (node offline)", gatewaySummary(display))
859+
}
860+
845861
@Test
846862
fun gatewaySummaryLeavesUnrelatedStatesUnaffectedByConnectionProblem() {
847863
val problem = authProblem("AUTH_TOKEN_MISSING")

0 commit comments

Comments
 (0)