Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(kit): tolerate transient account refresh failures

leepokai496e10e39582
diff --git a/apps/ios/App/CodyncApp.swift b/apps/ios/App/CodyncApp.swift
index 36a0f7e6..6bf69028 100644
--- a/apps/ios/App/CodyncApp.swift
+++ b/apps/ios/App/CodyncApp.swift
@@ -224,8 +224,10 @@ final class AppStore {
Task { [weak accounts] in
do {
try await cloud.registerDevice(name: UIDevice.current.name, platform: "ios")
- } catch {
+ } catch let error as CloudError {
accounts?.lastError = error.localizedDescription
+ } catch {
+ // Transient (network, token not ready): the next launch registers again.
}
await accounts?.refreshCloud()
}
diff --git a/apps/macos/App/HostController.swift b/apps/macos/App/HostController.swift
index 3d542542..920c9990 100644
--- a/apps/macos/App/HostController.swift
+++ b/apps/macos/App/HostController.swift
@@ -534,8 +534,10 @@ final class HostController {
Task { [weak accounts] in
do {
try await cloud.registerDevice(name: Host.current().localizedName ?? "Mac", platform: "macos")
- } catch {
+ } catch let error as CloudError {
accounts?.lastError = error.localizedDescription
+ } catch {
+ // Transient (network, token not ready): the next launch registers again.
}
await accounts?.refreshCloud()
}
diff --git a/kit/Sources/CodyncUI/Store/AccountStore.swift b/kit/Sources/CodyncUI/Store/AccountStore.swift
index f63222a1..cdbfdca1 100644
--- a/kit/Sources/CodyncUI/Store/AccountStore.swift
+++ b/kit/Sources/CodyncUI/Store/AccountStore.swift
@@ -1,6 +1,9 @@
import CodyncKit
import Foundation
import Observation
+import os
+
+private let log = Logger(subsystem: "com.pokai.Codync", category: "Account")
/// One bot across an account context's computers, for lists that mix them.
public struct RosterItem: Identifiable, Sendable {
@@ -174,8 +177,12 @@ public final class AccountStore {
guard !retired else { return }
if list != cloudComputers { Motion.animate { cloudComputers = list } }
if asksForAccess { await askForAccess() }
- } catch {
+ } catch let error as CloudError {
lastError = error.localizedDescription
+ } catch {
+ // Runs on every launch and foreground: a dropped connection or a token not ready yet
+ // fixes itself on the next refresh, so only the cloud's own answers reach the dialog.
+ log.info("cloud refresh failed: \(error.localizedDescription, privacy: .public)")
}
}