From 22d921dfeda62f430f5fec616d745a528441ac25 Mon Sep 17 00:00:00 2001 From: Ashlee Radka Date: Tue, 24 Feb 2026 14:44:58 -0500 Subject: [PATCH] fix: roll back optimistic removal in removeApprovedDevice on IPC failure Co-Authored-By: Claude Opus 4.6 --- .../Features/Settings/SettingsStore.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clients/macos/vellum-assistant/Features/Settings/SettingsStore.swift b/clients/macos/vellum-assistant/Features/Settings/SettingsStore.swift index cea77ae62da..9b32d20343c 100644 --- a/clients/macos/vellum-assistant/Features/Settings/SettingsStore.swift +++ b/clients/macos/vellum-assistant/Features/Settings/SettingsStore.swift @@ -1243,8 +1243,14 @@ public final class SettingsStore: ObservableObject { func removeApprovedDevice(hashedDeviceId: String) { guard let daemonClient else { return } + let removed = approvedDevices.filter { $0.hashedDeviceId == hashedDeviceId } approvedDevices.removeAll { $0.hashedDeviceId == hashedDeviceId } - try? daemonClient.sendApprovedDeviceRemove(hashedDeviceId: hashedDeviceId) + do { + try daemonClient.sendApprovedDeviceRemove(hashedDeviceId: hashedDeviceId) + } catch { + // IPC failed — restore optimistically removed devices + approvedDevices.append(contentsOf: removed) + } } func clearAllApprovedDevices() {