Skip to content

Commit 50b7061

Browse files
committed
fix(android): show auth recovery while approval loads
1 parent 6b45ac1 commit 50b7061

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,6 @@ internal fun recoveryGatewayDetail(
12211221
nodeCapabilityApprovalState == GatewayNodeApprovalState.Unapproved
12221222
) {
12231223
"Gateway paired. Waiting for node capability approval."
1224-
} else if (nodeCapabilityApprovalState == GatewayNodeApprovalState.Loading) {
1225-
"Gateway paired. Checking node capability approval."
12261224
} else if (gatewayConnectionProblem?.isPairingRequired == true && !gatewayConnectionProblem.canAutoRetry) {
12271225
recoveryGatewayApprovalCommand(gatewayConnectionProblem)
12281226
?.let { "Gateway approval is pending. Run this on the gateway host:" }
@@ -1231,6 +1229,8 @@ internal fun recoveryGatewayDetail(
12311229
"Gateway approval is in progress. OpenClaw will retry automatically."
12321230
} else if (gatewayConnectionProblem != null) {
12331231
recoveryGatewayAuthDetail(gatewayConnectionProblem)
1232+
} else if (nodeCapabilityApprovalState == GatewayNodeApprovalState.Loading) {
1233+
"Gateway paired. Checking node capability approval."
12341234
} else if (statusText.contains("operator offline", ignoreCase = true)) {
12351235
"Gateway paired. Waiting for operator access."
12361236
} else if (gatewayStatusLooksLikePairing(statusText)) {

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,29 @@ class OnboardingFlowLogicTest {
248248
)
249249
}
250250

251+
@Test
252+
fun recoveryGatewayDetailPrefersAuthProblemWhileNodeApprovalIsLoading() {
253+
assertEquals(
254+
"Saved authentication is invalid. Re-authenticate or reset this gateway connection.",
255+
recoveryGatewayDetail(
256+
ready = false,
257+
remoteAddress = "wss://gateway.example.test",
258+
statusText = "Connected (node offline)",
259+
nodeCapabilityApprovalState = GatewayNodeApprovalState.Loading,
260+
gatewayConnectionProblem =
261+
GatewayConnectionProblem(
262+
code = "AUTH_DEVICE_TOKEN_MISMATCH",
263+
message = "authentication needed",
264+
reason = null,
265+
requestId = null,
266+
recommendedNextStep = "update_auth_credentials",
267+
pauseReconnect = true,
268+
retryable = false,
269+
),
270+
),
271+
)
272+
}
273+
251274
@Test
252275
fun recoveryGatewayAuthDetailShowsSpecificAuthRecoveryActions() {
253276
val cases =

0 commit comments

Comments
 (0)