Harden panic recovery and service shutdown

This commit is contained in:
jack
2026-07-25 22:44:26 +02:00
parent 76d3b0f1ed
commit d1394392ed
21 changed files with 1237 additions and 113 deletions
+4
View File
@@ -18,6 +18,8 @@ final class MockKeychain: KeychainManagerProtocol {
var simulatedReadError: KeychainReadResult?
var simulatedSaveError: KeychainSaveResult?
var simulatedGenericReadError: KeychainReadResult?
var simulatedDeleteAllResult = true
private(set) var deleteAllCallCount = 0
func saveIdentityKey(_ keyData: Data, forKey key: String) -> Bool {
storage[key] = keyData
@@ -34,6 +36,8 @@ final class MockKeychain: KeychainManagerProtocol {
}
func deleteAllKeychainData() -> Bool {
deleteAllCallCount += 1
guard simulatedDeleteAllResult else { return false }
storage.removeAll()
serviceStorage.removeAll()
return true