release 1.3.1: remove API response bodies from diagnostics panel
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.3.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>74</string>
|
||||
<string>75</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>13.0</string>
|
||||
<key>LSUIElement</key>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user