From ddcb2a36ec7728c6df6c19c4f148f38e5104b2ad Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Mon, 1 Sep 2025 20:09:32 -0700 Subject: [PATCH] Fixes to agent reloading. (#656) --- .../Sources/SecretKit/PublicKeyStandinFileController.swift | 3 ++- .../Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Packages/Sources/SecretKit/PublicKeyStandinFileController.swift b/Sources/Packages/Sources/SecretKit/PublicKeyStandinFileController.swift index ada02d7..45bd222 100644 --- a/Sources/Packages/Sources/SecretKit/PublicKeyStandinFileController.swift +++ b/Sources/Packages/Sources/SecretKit/PublicKeyStandinFileController.swift @@ -26,7 +26,8 @@ public final class PublicKeyFileStoreController: Sendable { let untracked = Set(fullPathContents) .subtracting(validPaths) for path in untracked { - try? FileManager.default.removeItem(at: URL(fileURLWithPath: path)) + // string instead of fileURLWithPath since we're already using fileURL format. + try? FileManager.default.removeItem(at: URL(string: path)!) } } try? FileManager.default.createDirectory(at: URL(fileURLWithPath: directory), withIntermediateDirectories: false, attributes: nil) diff --git a/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift b/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift index 1953fa0..433759d 100644 --- a/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift +++ b/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift @@ -26,7 +26,7 @@ extension SecureEnclave { for await note in DistributedNotificationCenter.default().notifications(named: .secretStoreUpdated) { guard Constants.notificationToken != (note.object as? String) else { // Don't reload if we're the ones triggering this by reloading. - return + continue } reloadSecrets() }