mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(android): preserve disconnected node gateway status (#129839)
This commit is contained in:
committed by
GitHub
parent
0229fe7a2a
commit
fc64c5704a
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user