Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

fix(ios): renew legacy session sign-ins

Rach Pradhanc2898f4d61d0
diff --git a/apps/ios/Graff/Sources/GraffAccount.swift b/apps/ios/Graff/Sources/GraffAccount.swift
index 416ef07c..a53ac7be 100644
--- a/apps/ios/Graff/Sources/GraffAccount.swift
+++ b/apps/ios/Graff/Sources/GraffAccount.swift
@@ -106,9 +106,17 @@ struct AppSessionFull: Decodable {
enum GatewayError: LocalizedError {
case http(Int, String)
+
var errorDescription: String? {
switch self { case .http(let c, let m): return "gateway HTTP \(c): \(m)" }
}
+
+ var isInsufficientSessionScope: Bool {
+ switch self {
+ case .http(403, let message): return message.localizedCaseInsensitiveContains("sessions")
+ default: return false
+ }
+ }
}
enum Gateway {
diff --git a/apps/ios/Graff/Sources/SessionsListView.swift b/apps/ios/Graff/Sources/SessionsListView.swift
index d13e7a22..fc5a6a90 100644
--- a/apps/ios/Graff/Sources/SessionsListView.swift
+++ b/apps/ios/Graff/Sources/SessionsListView.swift
@@ -6,12 +6,23 @@ struct SessionsListView: View {
@State private var showAccount = false
@State private var showNewSession = false
@State private var loadNote = ""
+ @State private var needsSessionRelogin = false
var body: some View {
NavigationStack {
List {
if !loadNote.isEmpty {
- Text(loadNote).font(.footnote).foregroundStyle(.secondary)
+ VStack(alignment: .leading, spacing: 10) {
+ Text(loadNote).font(.footnote).foregroundStyle(.secondary)
+ if needsSessionRelogin {
+ Button("Sign in again") {
+ Gateway.signOut()
+ sessions = []
+ showAccount = true
+ }
+ .buttonStyle(.borderedProminent)
+ }
+ }
}
ForEach($sessions) { $session in
NavigationLink {
@@ -85,9 +96,17 @@ struct SessionsListView: View {
}
return s
}
+ needsSessionRelogin = false
loadNote = sessions.isEmpty ? "No sessions yet — tap + to build something." : ""
} catch {
- loadNote = error.localizedDescription
+ if let gatewayError = error as? GatewayError,
+ gatewayError.isInsufficientSessionScope {
+ needsSessionRelogin = true
+ loadNote = "This sign-in predates session sync. Sign in again to renew access."
+ } else {
+ needsSessionRelogin = false
+ loadNote = error.localizedDescription
+ }
}
}