From bd05e01d1cd08f4c4f4ccba9e261ca78d2f66858 Mon Sep 17 00:00:00 2001 From: Alan Wizemann Date: Fri, 1 May 2026 14:11:25 +0200 Subject: [PATCH] fix(webhooks-ios): surface parse failure in lastError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The post-load assignment was a true no-op: `self.lastError = parsed.isEmpty && !result.isEmpty ? nil : nil` — both ternary branches assigned `nil`. The intent (visible from the condition shape) was to set an error message when the CLI returned text but the parser produced no webhooks. Now that branch sets a "Couldn't parse webhook list output" message which the existing banner at line 33 renders. Normal flow (parse succeeds, or empty output) still clears the error. Co-Authored-By: Claude Opus 4.7 (1M context) --- scarf/Scarf iOS/Webhooks/WebhooksView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scarf/Scarf iOS/Webhooks/WebhooksView.swift b/scarf/Scarf iOS/Webhooks/WebhooksView.swift index 7dc55d1..7c3fbfe 100644 --- a/scarf/Scarf iOS/Webhooks/WebhooksView.swift +++ b/scarf/Scarf iOS/Webhooks/WebhooksView.swift @@ -91,8 +91,11 @@ struct WebhooksView: View { self.notEnabled = false let parsed = Self.parse(result) self.webhooks = parsed - self.lastError = parsed.isEmpty && !result.isEmpty - ? nil + // When the CLI returned text but the parser produced nothing, the + // user otherwise sees a silent empty list. Surface a parse-failure + // message so they know to dig deeper. + self.lastError = (parsed.isEmpty && !result.isEmpty) + ? "Couldn't parse webhook list output" : nil }