From 22bcdeffd44535f080ee4658a455639d6e6732ad Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 27 Jul 2025 16:33:44 +0200 Subject: [PATCH] Fix remaining compilation warnings - Remove unnecessary nil check for non-optional URL in PathSplittingTests - Add CodingKeys enum to ServerEvent to explicitly exclude auto-generated id property from encoding/decoding This resolves all compilation warnings except the harmless AppIntents metadata warning. --- mac/VibeTunnel/Core/Services/ServerEvent.swift | 15 +++++++++++++++ mac/VibeTunnelTests/PathSplittingTests.swift | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mac/VibeTunnel/Core/Services/ServerEvent.swift b/mac/VibeTunnel/Core/Services/ServerEvent.swift index 5ff9845a..481f2985 100644 --- a/mac/VibeTunnel/Core/Services/ServerEvent.swift +++ b/mac/VibeTunnel/Core/Services/ServerEvent.swift @@ -363,4 +363,19 @@ struct ServerEvent: Codable, Identifiable, Equatable { formatter.timeStyle = .medium return formatter.string(from: timestamp) } + + // MARK: - Codable + + /// Coding keys to exclude `id` from encoding/decoding since it's auto-generated + enum CodingKeys: String, CodingKey { + case type + case sessionId + case sessionName + case command + case exitCode + case duration + case processInfo + case message + case timestamp + } } diff --git a/mac/VibeTunnelTests/PathSplittingTests.swift b/mac/VibeTunnelTests/PathSplittingTests.swift index 8f09d065..0ffb5cdf 100644 --- a/mac/VibeTunnelTests/PathSplittingTests.swift +++ b/mac/VibeTunnelTests/PathSplittingTests.swift @@ -25,8 +25,7 @@ struct PathSplittingTests { let fileManager = FileManager.default let exists = fileManager.fileExists(atPath: nonExistentPath) - // URL is still created even for non-existent paths - #expect(url != nil) + // URL is always created for any path (even non-existent ones) #expect(url.path == nonExistentPath) #expect(!exists) }