mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 08:01:38 +00:00
* fix(ios): keep reconnect errors visible * fix(ios): clear stale errors on gateway switch * chore(ios): keep release notes in PR * fix(ios): reset status when switching gateways * fix(ios): retain errors through same-target reconnect * fix(ios): unpause explicit pairing retries * fix(ios): isolate retained reconnect errors * chore(i18n): resync rebased native inventory * fix(ios): separate reconnect display state
44 lines
1.4 KiB
Swift
44 lines
1.4 KiB
Swift
import OpenClawKit
|
|
import Testing
|
|
@testable import OpenClaw
|
|
|
|
struct OnboardingConnectPhaseTests {
|
|
@Test func `previous error remains visible while reconnecting`() {
|
|
let problem = GatewayConnectionProblem(
|
|
kind: .timeout,
|
|
owner: .network,
|
|
title: "Connection timed out",
|
|
message: "The gateway did not respond before the connection timed out.",
|
|
retryable: true,
|
|
pauseReconnect: false)
|
|
|
|
let phase = OnboardingConnectPhase.resolve(
|
|
problem: problem,
|
|
connectingDetail: "Reconnecting…",
|
|
localFailure: nil,
|
|
retryableFailure: nil)
|
|
|
|
#expect(phase == .failed(problem))
|
|
}
|
|
|
|
@Test func `reconnect progress shows when no error remains`() {
|
|
let phase = OnboardingConnectPhase.resolve(
|
|
problem: nil,
|
|
connectingDetail: "Reconnecting…",
|
|
localFailure: nil,
|
|
retryableFailure: nil)
|
|
|
|
#expect(phase == .connecting(detail: "Reconnecting…"))
|
|
}
|
|
|
|
@Test func `local failure keeps precedence over reconnect progress`() {
|
|
let phase = OnboardingConnectPhase.resolve(
|
|
problem: nil,
|
|
connectingDetail: "Reconnecting…",
|
|
localFailure: "No connection to retry.",
|
|
retryableFailure: nil)
|
|
|
|
#expect(phase == .failedStatus(message: "No connection to retry.", allowsRetry: false))
|
|
}
|
|
}
|