From a7608eef3eaf6ff934c267080f287d011b07b25e Mon Sep 17 00:00:00 2001 From: Erik Doernenburg Date: Fri, 5 Apr 2024 20:04:25 -0700 Subject: [PATCH] Fixed a bug that resulted in tests creating empty tokens in Keychain. --- CCMenu/Source/Miscellaneous/Keychain.swift | 2 +- CCMenu/Source/Server Monitor/CCTrayFeedReader.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CCMenu/Source/Miscellaneous/Keychain.swift b/CCMenu/Source/Miscellaneous/Keychain.swift index a17981d..2ba5516 100644 --- a/CCMenu/Source/Miscellaneous/Keychain.swift +++ b/CCMenu/Source/Miscellaneous/Keychain.swift @@ -60,7 +60,7 @@ class Keychain { func getToken(forService service: String) throws -> String? { if service == "GitHub", let token = UserDefaults.active.string(forKey: "GitHubToken") { - return token + return token.isEmpty ? nil : token } let query: [String: Any] = [ kSecClass as String: kSecClassGenericPassword, diff --git a/CCMenu/Source/Server Monitor/CCTrayFeedReader.swift b/CCMenu/Source/Server Monitor/CCTrayFeedReader.swift index ca98682..56a97db 100644 --- a/CCMenu/Source/Server Monitor/CCTrayFeedReader.swift +++ b/CCMenu/Source/Server Monitor/CCTrayFeedReader.swift @@ -39,6 +39,7 @@ class CCTrayFeedReader { do { // All pipelines have the same URL. let request = try requestForFeed(feed: pipelines[0].feed) + debugPrint(Date(), "fetching", request.url ?? "") try await fetchStatus(request: request) } catch { for i in 0..