From ac4f8b9050d1380bba87d4e744ad39223761e0ae Mon Sep 17 00:00:00 2001 From: rzen Date: Sun, 9 Aug 2026 20:56:37 -0400 Subject: [PATCH] =?UTF-8?q?Three=20warnings=20go=20quiet=20=E2=80=94=20a?= =?UTF-8?q?=20weak=20binding=20turns=20let,=20the=20typed=20catch=20drops?= =?UTF-8?q?=20its=20dead=20generic=20twin,=20and=20a=20trash=20receipt=20i?= =?UTF-8?q?s=20discarded=20on=20purpose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy --- Kanban/App/AppCommands.swift | 2 +- Kanban/App/BoardShareStager.swift | 7 ++----- Kanban/LiveStore/BoardStore.swift | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Kanban/App/AppCommands.swift b/Kanban/App/AppCommands.swift index d57d869..c0f968e 100644 --- a/Kanban/App/AppCommands.swift +++ b/Kanban/App/AppCommands.swift @@ -516,7 +516,7 @@ struct ShareBoardCommand: View { Task { @MainActor in // Weak: the window this share was invoked from must not be kept alive by this task // across the flush's `await` just so the picker can anchor to it later. - weak var invokedWindow = NSApp.keyWindow ?? NSApp.mainWindow + weak let invokedWindow = NSApp.keyWindow ?? NSApp.mainWindow let cancellation = BoardCopyCancellation() let operation = store.banners.beginOperation( diff --git a/Kanban/App/BoardShareStager.swift b/Kanban/App/BoardShareStager.swift index 62fceb3..5c7cafe 100644 --- a/Kanban/App/BoardShareStager.swift +++ b/Kanban/App/BoardShareStager.swift @@ -206,17 +206,14 @@ enum BoardShareStager { do { try DittoZipArchiver.zip(contentsOf: treeCopy, to: zipURL) - } catch let zipFailure as DittoZipArchiver.Failure { + } catch { try? FileManager.default.removeItem(at: root) - switch zipFailure { + switch error { case let .launchFailed(message): throw failure(at: treeCopy, "could not start the archiver: \(message)") case let .nonZeroExit(status, message): throw failure(at: treeCopy, "the archiver exited with status \(status): \(message)") } - } catch { - try? FileManager.default.removeItem(at: root) - throw failure(at: treeCopy, "could not create the zip: \(error.localizedDescription)") } // The zip is what the picker shares; the decompressed tree underneath it was only ever a diff --git a/Kanban/LiveStore/BoardStore.swift b/Kanban/LiveStore/BoardStore.swift index da2f3c1..1dc997e 100644 --- a/Kanban/LiveStore/BoardStore.swift +++ b/Kanban/LiveStore/BoardStore.swift @@ -2371,7 +2371,7 @@ public final class BoardStore: HealHost { guard let priorImage, priorImage != newReference, let bareName = BoardBackdrop.qualifiedBareName(of: priorImage) else { return } - try? BoardWriter.trashBoardImage( + _ = try? BoardWriter.trashBoardImage( named: bareName, inFolder: backgroundsFolder, healMarked: false, operation: .tidyBackgroundImage(filename: bareName) )