From 9af0d6401c6b3a8e99f21277c6ce8a68c1ef30f9 Mon Sep 17 00:00:00 2001 From: superdooper86 Date: Mon, 11 May 2026 13:45:09 +0200 Subject: [PATCH] release 1.3.1: remove API response bodies from diagnostics panel --- ClaudeChecker/DiagnosticsView.swift | 35 ----------------------------- ClaudeChecker/Info.plist | 4 ++-- ClaudeChecker/UsageViewModel.swift | 5 ----- RELEASE_NOTES.md | 14 +++--------- 4 files changed, 5 insertions(+), 53 deletions(-) diff --git a/ClaudeChecker/DiagnosticsView.swift b/ClaudeChecker/DiagnosticsView.swift index c9bc9f1..d4a8482 100644 --- a/ClaudeChecker/DiagnosticsView.swift +++ b/ClaudeChecker/DiagnosticsView.swift @@ -66,36 +66,6 @@ struct DiagnosticsView: View { Divider() - // Bootstrap body - if !vm.diagBootstrapBody.isEmpty { - DiagSection(title: "Bootstrap Response (first 500 chars)") { - Text(vm.diagBootstrapBody) - .font(.system(size: 10, design: .monospaced)) - .foregroundColor(.secondary) - .textSelection(.enabled) - .frame(maxWidth: .infinity, alignment: .leading) - .padding(8) - .background(Color.primary.opacity(0.04)) - .cornerRadius(5) - } - Divider() - } - - // Response body - if !vm.diagLastBody.isEmpty { - DiagSection(title: "Last API Response (first 500 chars)") { - Text(vm.diagLastBody) - .font(.system(size: 10, design: .monospaced)) - .foregroundColor(.secondary) - .textSelection(.enabled) - .frame(maxWidth: .infinity, alignment: .leading) - .padding(8) - .background(Color.primary.opacity(0.04)) - .cornerRadius(5) - } - Divider() - } - // Cookie summary DiagSection(title: "Cookie Store") { DiagRow("Total cookies", "\(vm.diagCookieCount)") @@ -190,11 +160,6 @@ struct DiagnosticsView: View { lines.append("Claude cookies: \(vm.diagClaudeCookieCount)") lines.append("Domains: \(vm.diagCookieDomains.joined(separator: ", "))") lines.append("") - lines.append("Bootstrap body:") - lines.append(vm.diagBootstrapBody) - lines.append("") - lines.append("Last API response:") - lines.append(vm.diagLastBody) lines.append("") lines.append("Live cookies:") for c in liveAllCookies { diff --git a/ClaudeChecker/Info.plist b/ClaudeChecker/Info.plist index b640d74..14eb249 100644 --- a/ClaudeChecker/Info.plist +++ b/ClaudeChecker/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.3.0 + 1.3.1 CFBundleVersion - 74 + 75 LSMinimumSystemVersion 13.0 LSUIElement diff --git a/ClaudeChecker/UsageViewModel.swift b/ClaudeChecker/UsageViewModel.swift index 20da8cb..069ef13 100644 --- a/ClaudeChecker/UsageViewModel.swift +++ b/ClaudeChecker/UsageViewModel.swift @@ -40,10 +40,8 @@ class UsageViewModel: ObservableObject { @Published var diagCookieDomains: [String] = [] @Published var diagLastPath: String = "" @Published var diagLastStatus: Int = 0 - @Published var diagLastBody: String = "" @Published var diagLastError: String = "" @Published var diagLastActiveOrg: String = "" // lastActiveOrg cookie value from JS - @Published var diagBootstrapBody: String = "" // raw bootstrap response (first 500 chars) @Published var diagLastFetch: Date? = nil init() { @@ -117,7 +115,6 @@ class UsageViewModel: ObservableObject { diagLastPath = path diagLastFetch = Date() diagLastStatus = status - diagLastBody = String(body.prefix(500)) diagLastError = status != 200 ? "JS HTTP \(status)" : "" return (status, body) } @@ -181,7 +178,6 @@ class UsageViewModel: ObservableObject { guard let http = response as? HTTPURLResponse else { throw AppError.networkError } let body = String(data: data, encoding: .utf8) ?? "" diagLastStatus = http.statusCode - diagLastBody = String(body.prefix(500)) if http.statusCode != 200 { diagLastError = "HTTP \(http.statusCode)" } @@ -315,7 +311,6 @@ class UsageViewModel: ObservableObject { guard body.trimmingCharacters(in: .whitespacesAndNewlines).hasPrefix("{") else { throw AppError.detail("Non-JSON response (HTML?): \(body.prefix(80))") } - diagBootstrapBody = String(body.prefix(500)) guard let data = body.data(using: .utf8), let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else { return (nil, nil, nil) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1cd1ea0..438105e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,12 +1,4 @@ -## What's new in v1.3.0 +## What's new in v1.3.1 -### Multi-org support -- App now uses the `lastActiveOrg` cookie to identify which organisation is active, matching exactly what the claude.ai frontend does. Previously the app always picked the first org returned by bootstrap, which is the personal "Individual Org" for users with multiple organisations — causing persistent 403 errors on all usage endpoints. -- Plan label (e.g. **Max**, **Pro**, **Team**) now reads capabilities from the active org, not the first membership. - -### Reliable API access via WebView -- All API calls now run through `WKWebView.callAsyncJavaScript`, making real same-origin browser requests instead of URLSession. Claude.ai's org-specific endpoints reject native HTTP clients (403) even with correct cookies and headers; running inside the browser context passes all server-side checks. -- A background WebView is created at startup when session cookies are detected, so usage data loads immediately without requiring a manual sign-in. - -### Diagnostics -- New **Diagnostics** panel in Settings shows cookie store, last API request/response, bootstrap body, and the `lastActiveOrg` cookie value — making it easy to report issues. +### Privacy +- Diagnostics panel no longer displays API response bodies, which could contain account and financial data. Status codes, error messages, cookie names, and request paths are still shown.