mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
ios: stop onboarding auth step-3 reconnect loop
This commit is contained in:
committed by
Mariano Belinky
parent
0c87dbdcfc
commit
9035a07af3
@@ -1626,6 +1626,10 @@ private extension NodeAppModel {
|
||||
try? await Task.sleep(nanoseconds: 1_000_000_000)
|
||||
continue
|
||||
}
|
||||
if !self.gatewayAutoReconnectEnabled {
|
||||
try? await Task.sleep(nanoseconds: 1_000_000_000)
|
||||
continue
|
||||
}
|
||||
if await self.isOperatorConnected() {
|
||||
try? await Task.sleep(nanoseconds: 1_000_000_000)
|
||||
continue
|
||||
@@ -1708,6 +1712,10 @@ private extension NodeAppModel {
|
||||
try? await Task.sleep(nanoseconds: 1_000_000_000)
|
||||
continue
|
||||
}
|
||||
if !self.gatewayAutoReconnectEnabled {
|
||||
try? await Task.sleep(nanoseconds: 1_000_000_000)
|
||||
continue
|
||||
}
|
||||
if await self.isGatewayConnected() {
|
||||
try? await Task.sleep(nanoseconds: 1_000_000_000)
|
||||
continue
|
||||
@@ -1795,10 +1803,18 @@ private extension NodeAppModel {
|
||||
}
|
||||
GatewayDiagnostics.log("gateway connect error: \(error.localizedDescription)")
|
||||
|
||||
// If auth is missing/rejected, pause reconnect churn until the user intervenes.
|
||||
// Reconnect loops only spam the same failing handshake and make onboarding noisy.
|
||||
let lower = error.localizedDescription.lowercased()
|
||||
if lower.contains("unauthorized") || lower.contains("gateway token missing") {
|
||||
await MainActor.run {
|
||||
self.gatewayAutoReconnectEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
// If pairing is required, stop reconnect churn. The user must approve the request
|
||||
// on the gateway before another connect attempt will succeed, and retry loops can
|
||||
// generate multiple pending requests.
|
||||
let lower = error.localizedDescription.lowercased()
|
||||
if lower.contains("not_paired") || lower.contains("pairing required") {
|
||||
let requestId: String? = {
|
||||
// GatewayResponseError for connect decorates the message with `(requestId: ...)`.
|
||||
|
||||
@@ -818,7 +818,7 @@ struct OnboardingWizardView: View {
|
||||
|
||||
private func retryLastAttempt() async {
|
||||
self.connectingGatewayID = "retry"
|
||||
self.issue = .none
|
||||
// Keep current auth/pairing issue sticky while retrying to avoid Step 3 UI flip-flop.
|
||||
self.connectMessage = "Retrying…"
|
||||
self.statusLine = "Retrying last connection…"
|
||||
defer { self.connectingGatewayID = nil }
|
||||
|
||||
Reference in New Issue
Block a user