taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit da73eff09ab38c098b656f3ea01898e2eb5d58f8
parent 8420e7906405a8b2a972fd7bd86fd37f8392200e
Author: Marc Stibane <marc@taler.net>
Date:   Thu,  4 Dec 2025 08:12:52 +0100

Debugging

Diffstat:
MTalerWallet1/Backend/WalletCore.swift | 34+++++++++++++++++-----------------
MTalerWallet1/Controllers/DebugViewC.swift | 1+
MTalerWallet1/Model/WalletModel.swift | 14+++++++-------
MTalerWallet1/Views/Actions/Banking/DepositSelectV.swift | 5++---
4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/TalerWallet1/Backend/WalletCore.swift b/TalerWallet1/Backend/WalletCore.swift @@ -204,7 +204,7 @@ extension WalletCore { postNotification(.TransactionError, userInfo: [NOTIFICATIONERROR: WalletBackendError.walletCoreError(errorInfo)]) } guard decoded.newTxState != decoded.oldTxState else { - logger.info("No State change: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.info("handleStateTransition: No State change: \(decoded.transactionId, privacy: .private(mask: .hash))") return } @@ -217,7 +217,7 @@ extension WalletCore { let oldMinor = decoded.oldTxState?.minor switch newMajor { case .done: - logger.info("Done: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.info("handleStateTransition: Done: \(decoded.transactionId, privacy: .private(mask: .hash))") if type.isWithdrawal { Controller.shared.playSound(2) // play payment_received only for withdrawals } else if !type.isIncoming { @@ -225,14 +225,14 @@ extension WalletCore { Controller.shared.playSound(1) // play payment_sent for all outgoing tx } } else { // incoming but not withdrawal - logger.info("incoming payment done - NO sound - \(type.rawValue)") + logger.info(" incoming payment done - NO sound - \(type.rawValue)") } postNotification(.TransactionDone, userInfo: [TRANSACTIONTRANSITION: decoded]) return case .aborting: if let newMinor { if newMinor == .refreshExpired { - logger.warning("RefreshExpired: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.warning("handleStateTransition: RefreshExpired: \(decoded.transactionId, privacy: .private(mask: .hash))") if let index = expired.firstIndex(of: components[2]) { expired.remove(at: index) // don't beep twice } else { @@ -243,10 +243,10 @@ extension WalletCore { return } } - logger.warning("Unknown aborting: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.log("handleStateTransition: Aborting: \(decoded.transactionId, privacy: .private(mask: .hash))") postNotification(.TransactionStateTransition, userInfo: [TRANSACTIONTRANSITION: decoded]) case .expired: - logger.warning("Expired: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.warning("handleStateTransition: Expired: \(decoded.transactionId, privacy: .private(mask: .hash))") if let index = expired.firstIndex(of: components[2]) { expired.remove(at: index) // don't beep twice } else { @@ -257,7 +257,7 @@ extension WalletCore { case .pending: if let newMinor { if newMinor == .ready { - logger.log("PendingReady: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.log("handleStateTransition: PendingReady: \(decoded.transactionId, privacy: .private(mask: .hash))") postNotification(.PendingReady, userInfo: [TRANSACTIONTRANSITION: decoded]) return } else if newMinor == .exchangeWaitReserve // user did confirm on bank website @@ -266,20 +266,20 @@ extension WalletCore { postNotification(.DismissSheet, userInfo: [TRANSACTIONTRANSITION: decoded]) return } else if newMinor == .kyc { // user did confirm on bank website, but KYC is needed - logger.log("KYCrequired: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.log("handleStateTransition: KYCrequired: \(decoded.transactionId, privacy: .private(mask: .hash))") postNotification(.KYCrequired, userInfo: [TRANSACTIONTRANSITION: decoded]) return } - logger.trace("Pending:\(newMinor.rawValue, privacy: .public) \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.trace("handleStateTransition: Pending:\(newMinor.rawValue, privacy: .public) \(decoded.transactionId, privacy: .private(mask: .hash))") } else { - logger.trace("Pending: \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.trace("handleStateTransition: Pending: \(decoded.transactionId, privacy: .private(mask: .hash))") } postNotification(.TransactionStateTransition, userInfo: [TRANSACTIONTRANSITION: decoded]) default: if let newMinor { - logger.log("\(newMajor.rawValue, privacy: .public):\(newMinor.rawValue, privacy: .public) \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.log("handleStateTransition: \(newMajor.rawValue, privacy: .public):\(newMinor.rawValue, privacy: .public) \(decoded.transactionId, privacy: .private(mask: .hash))") } else { - logger.warning("\(newMajor.rawValue, privacy: .public): \(decoded.transactionId, privacy: .private(mask: .hash))") + logger.warning("handleStateTransition: \(newMajor.rawValue, privacy: .public): \(decoded.transactionId, privacy: .private(mask: .hash))") } postNotification(.TransactionStateTransition, userInfo: [TRANSACTIONTRANSITION: decoded]) } // switch @@ -287,18 +287,18 @@ extension WalletCore { } // 3 components return } catch DecodingError.dataCorrupted(let context) { - logger.error("\(context.debugDescription)") + logger.error("handleStateTransition: \(context.debugDescription)") } catch DecodingError.keyNotFound(let key, let context) { - logger.error("Key '\(key.stringValue)' not found:\(context.debugDescription)") + logger.error("handleStateTransition: Key '\(key.stringValue)' not found:\(context.debugDescription)") logger.error("\(context.codingPath)") } catch DecodingError.valueNotFound(let value, let context) { - logger.error("Value '\(value)' not found:\(context.debugDescription)") + logger.error("handleStateTransition: Value '\(value)' not found:\(context.debugDescription)") logger.error("\(context.codingPath)") } catch DecodingError.typeMismatch(let type, let context) { - logger.error("Type '\(type)' mismatch:\(context.debugDescription)") + logger.error("handleStateTransition: Type '\(type)' mismatch:\(context.debugDescription)") logger.error("\(context.codingPath)") } catch let error { // rethrows - logger.error("\(error.localizedDescription)") + logger.error("handleStateTransition: \(error.localizedDescription)") } throw WalletBackendError.walletCoreError(nil) // TODO: error? } diff --git a/TalerWallet1/Controllers/DebugViewC.swift b/TalerWallet1/Controllers/DebugViewC.swift @@ -32,6 +32,7 @@ public let VIEW_ABOUT = VIEW_SETTINGS + 1 // 13 AboutV public let VIEW_PAYMENT_SERVICES = VIEW_ABOUT + 1 // 14 ExchangeListView public let VIEW_BANK_ACCOUNTS = VIEW_PAYMENT_SERVICES + 1 // 15 BankListView public let VIEW_BACKUP = VIEW_BANK_ACCOUNTS + 1 // 16 BackupView +public let VIEW_CAROUSEL = VIEW_BACKUP + 1 // 17 CarouselView // MARK: Transactions public let VIEW_EMPTY_HISTORY = VIEW_EMPTY_WALLET + 10 // 20 TransactionsEmptyView diff --git a/TalerWallet1/Model/WalletModel.swift b/TalerWallet1/Model/WalletModel.swift @@ -375,18 +375,18 @@ extension WalletModel { if fileManager.fileExists(atPath: sourcePath) { do { try fileManager.moveItem(at: sourceUrl, to: targetUrl) - logger.debug("moved to \(target.path)") + logger.debug("migrate: moved to \(target.path)") } catch { - logger.error("move failed \(error.localizedDescription)") + logger.error("migrate: move failed \(error.localizedDescription)") } } else { - logger.debug("no db at \(sourcePath)") + logger.debug("migrate: nothing to do, no db at \(sourcePath)") } if fileManager.fileExists(atPath: targetPath) { // logger.debug("found db at \(targetPath)") } else { - logger.debug("no db at \(targetPath)") + logger.debug("migrate: nothing to do, no db at \(targetPath)") } } @@ -401,10 +401,10 @@ extension WalletModel { return appSupport.path(withSlash: true) #endif } else { // should never happen - logger.error("No applicationSupportDirectory") + logger.error("dbPath: No applicationSupportDirectory") } } else { // should never happen - logger.error("No documentDirectory") + logger.error("dbPath: No documentDirectory") } throw WalletBackendError.initializationError } @@ -426,7 +426,7 @@ extension WalletModel { return cachePath } else { // should never happen - logger.error("No cachesDirectory") + logger.error("cachePath: No cachesDirectory") throw WalletBackendError.initializationError } } diff --git a/TalerWallet1/Views/Actions/Banking/DepositSelectV.swift b/TalerWallet1/Views/Actions/Banking/DepositSelectV.swift @@ -97,13 +97,12 @@ struct DepositSelectV: View { await viewDidLoad() } .navigationTitle(subjectTitle) -// .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all)) .onAppear { DebugViewC.shared.setViewID(VIEW_DEPOSIT_ACCEPT, stack: stack.push()) -// print("❗️ DepositSelectV onAppear") +// symLog.log("❗️ DepositSelectV onAppear") } .onDisappear { -// print("❗️ DepositSelectV onDisappear") +// symLog.log("❗️ DepositSelectV onDisappear") } // .task(id: depositIBAN) { await validateIban() } }