Skip to content

Commit

Permalink
Better debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Mar 8, 2024
1 parent cd61577 commit 4294e24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/SpeziFirebaseAccount/Models/FirebaseContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ actor FirebaseContext {
if let lastActiveAccountServiceId,
let service = registeredServices.first(where: { $0.id == lastActiveAccountServiceId }) {
self.lastActiveAccountService = service
Self.logger.debug("Last active account service is \(service.id)")
}

// get notified about changes of the User reference
Expand Down Expand Up @@ -127,11 +128,9 @@ actor FirebaseContext {
private nonisolated func removeCredentials(userId: String, server: String) {
do {
try secureStorage.deleteCredentials(userId, server: server)
} catch SecureStorageError.notFound {
// we don't care if we want to delete something that doesn't exist
} catch {
if let cocoaError = error as? CocoaError,
cocoaError.isFileError {
return // silence any file errors (e.g. file doesn't exist)
}
Self.logger.error("Failed to remove credentials: \(error)")
}
}
Expand Down Expand Up @@ -185,6 +184,8 @@ actor FirebaseContext {

do {
try secureStorage.deleteCredentials("_", server: StorageKeys.activeAccountService)
} catch SecureStorageError.notFound {
// we don't care if we want to delete something that doesn't exist
} catch {
Self.logger.error("Failed to remove active account service: \(error)")
}
Expand Down

0 comments on commit 4294e24

Please sign in to comment.