From 35e0894655de839964aa279554e037e88c3dd204 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 20 Dec 2025 17:13:56 +0100 Subject: [PATCH] fix: merge bonjour txt records for ssh autofill --- .../Sources/Clawdis/GatewayDiscoveryModel.swift | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/macos/Sources/Clawdis/GatewayDiscoveryModel.swift b/apps/macos/Sources/Clawdis/GatewayDiscoveryModel.swift index 1c0319323..a0bdb7f69 100644 --- a/apps/macos/Sources/Clawdis/GatewayDiscoveryModel.swift +++ b/apps/macos/Sources/Clawdis/GatewayDiscoveryModel.swift @@ -179,8 +179,17 @@ final class GatewayDiscoveryModel { } private static func txtDictionary(from result: NWBrowser.Result) -> [String: String] { - guard case let .bonjour(txt) = result.metadata else { return [:] } - return txt.dictionary + var merged: [String: String] = [:] + + if case let .bonjour(txt) = result.metadata { + merged.merge(txt.dictionary, uniquingKeysWith: { _, new in new }) + } + + if let endpointTxt = result.endpoint.txtRecord?.dictionary { + merged.merge(endpointTxt, uniquingKeysWith: { _, new in new }) + } + + return merged } private static func prettifyInstanceName(_ decodedName: String) -> String {