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) }