Harden panic recovery and service shutdown

This commit is contained in:
jack
2026-07-26 00:12:26 +02:00
parent 76d3b0f1ed
commit b081c98dba
22 changed files with 1236 additions and 126 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