[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 02/05: Debugging, cleanup
From: |
gnunet |
Subject: |
[taler-taler-ios] 02/05: Debugging, cleanup |
Date: |
Fri, 13 Dec 2024 12:40:31 +0100 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 7214b8400e1a5960249b13cb6a8fe1acc33a1756
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Dec 13 12:27:12 2024 +0100
Debugging, cleanup
---
TalerWallet1/Backend/WalletCore.swift | 33 ++++++++++++++-----------
TalerWallet1/Views/HelperViews/TabBarView.swift | 1 -
TalerWallet1/Views/Main/WalletEmptyView.swift | 5 ----
3 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/TalerWallet1/Backend/WalletCore.swift
b/TalerWallet1/Backend/WalletCore.swift
index 03d29c6..5dbe9e4 100644
--- a/TalerWallet1/Backend/WalletCore.swift
+++ b/TalerWallet1/Backend/WalletCore.swift
@@ -302,7 +302,7 @@ extension WalletCore {
throw WalletBackendError.walletCoreError(nil) // TODO: error?
}
- @MainActor private func handleNotification(_ anyCodable: AnyCodable?)
throws {
+ @MainActor private func handleNotification(_ anyCodable: AnyCodable?, _
message: String) throws {
guard let anyPayload = anyCodable else {
throw WalletBackendError.deserializationError
}
@@ -312,24 +312,27 @@ extension WalletCore {
switch payload.type {
case Notification.Name.Idle.rawValue:
-// symLog.log(anyPayload)
+ symLog.log(message)
break
case Notification.Name.ExchangeStateTransition.rawValue:
-// symLog.log(anyPayload)
+ symLog.log(message)
break
case Notification.Name.TransactionStateTransition.rawValue:
- symLog.log(anyPayload)
+ symLog.log(message)
try handleStateTransition(jsonData)
case Notification.Name.PendingOperationProcessed.rawValue:
try handlePendingProcessed(payload)
case Notification.Name.BalanceChange.rawValue:
- symLog.log(anyPayload)
+ symLog.log(message)
postNotification(.BalanceChange)
+ case Notification.Name.BankAccountChange.rawValue:
+ symLog.log(message)
+ postNotification(.BankAccountChange)
case Notification.Name.ExchangeAdded.rawValue:
- symLog.log(anyPayload)
+ symLog.log(message)
postNotification(.ExchangeAdded)
case Notification.Name.ExchangeDeleted.rawValue:
- symLog.log(anyPayload)
+ symLog.log(message)
postNotification(.ExchangeDeleted)
case Notification.Name.ReserveNotYetFound.rawValue:
if let reservePub = payload.reservePub {
@@ -338,15 +341,15 @@ extension WalletCore {
} // else { throw WalletBackendError.deserializationError
} shouldn't happen, but if it does just ignore it
case Notification.Name.ProposalAccepted.rawValue:
// "proposal-accepted":
- symLog.log(anyPayload)
+ symLog.log(message)
postNotification(.ProposalAccepted, userInfo: nil)
case Notification.Name.ProposalDownloaded.rawValue:
// "proposal-downloaded":
- symLog.log(anyPayload)
+ symLog.log(message)
postNotification(.ProposalDownloaded, userInfo: nil)
case Notification.Name.TaskObservabilityEvent.rawValue,
Notification.Name.RequestObservabilityEvent.rawValue:
if isObserving != 0 {
- symLog.log(anyPayload)
+ symLog.log(message)
let timestamp = TalerDater.dateString()
if let event = payload.event, let json =
event.toJSON() {
let type = event["type"]?.value as? String
@@ -362,11 +365,11 @@ extension WalletCore {
// "refresh-revealed", "refresh-unwarranted":
// break
default:
-print("\n❗️ WalletCore.swift:343 NEW Notification: ", anyPayload, "\n")
// this is a new notification I haven't seen before
+print("\n❗️ WalletCore.swift:368 NEW Notification: ", message, "\n") //
this is a new notification I haven't seen before
break
}
} catch let error {
- symLog.log("Error \(error) parsing notification: \(anyPayload)")
// TODO: .error
+ symLog.log("Error \(error) parsing notification: \(message)")
// TODO: .error
postNotification(.Error, userInfo: [NOTIFICATIONERROR: error])
// TODO: if DevMode then should log into file for user
}
@@ -423,7 +426,7 @@ print("\n❗️ WalletCore.swift:343 NEW Notification: ",
anyPayload, "\n")
try handleResponse(decoded)
case "notification":
// symLog.log(message)
- try handleNotification(decoded.payload)
+ try handleNotification(decoded.payload, message)
case "tunnelHttp": // TODO: Handle tunnelHttp
symLog.log("Can't handle tunnelHttp: \(message)") //
TODO: .error
throw WalletBackendError.deserializationError
@@ -463,9 +466,9 @@ print("\n❗️ WalletCore.swift:343 NEW Notification: ",
anyPayload, "\n")
self.semaphore.signal() // free requestsMade
let args = try JSONEncoder().encode(request.args)
if let jsonArgs = String(data: args, encoding: .utf8) {
- self.logger.log("🔴 \(request.operation, privacy:
.public) (\(requestId, privacy: .public)) \(jsonArgs, privacy: .auto)")
+ self.logger.log("🔴\"id\":\(requestId, privacy:
.public) \(request.operation, privacy: .public)\(jsonArgs, privacy: .auto)")
} else { // should NEVER happen since the whole request
was already successfully encoded and stringified
- self.logger.log("🔴 \(request.operation, privacy:
.public) (\(requestId, privacy: .public)) 🔴 Error: jsonArgs")
+ self.logger.log("🔴\"id\":\(requestId, privacy:
.public) \(request.operation, privacy: .public) 🔴 Error: jsonArgs")
}
self.quickjs.sendMessage(message: jsonString)
// self.symLog.log(jsonString)
diff --git a/TalerWallet1/Views/HelperViews/TabBarView.swift
b/TalerWallet1/Views/HelperViews/TabBarView.swift
index dff86ee..f1d4392 100644
--- a/TalerWallet1/Views/HelperViews/TabBarView.swift
+++ b/TalerWallet1/Views/HelperViews/TabBarView.swift
@@ -129,7 +129,6 @@ struct TabBarView: View {
actionTab.onTapGesture {
onActionTab()
tapped += 1
-// dragged = 0
}
settingsTab.onTapGesture { selection = .settings;
userAction += 1 }
}
diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift
b/TalerWallet1/Views/Main/WalletEmptyView.swift
index 69f6cce..d9b65d0 100644
--- a/TalerWallet1/Views/Main/WalletEmptyView.swift
+++ b/TalerWallet1/Views/Main/WalletEmptyView.swift
@@ -50,11 +50,6 @@ struct WalletEmptyView: View {
}
.buttonStyle(TalerButtonStyle(type: .prominent, narrow: false,
disabled: withDrawDisabled, aligned: .center))
.disabled(withDrawDisabled)
-
-// Link(title, destination: URL(string: DEMOBANK)!)
-// .buttonStyle(TalerButtonStyle(type: .prominent, narrow:
false, aligned: .center))
-// .padding(.vertical)
-// .accessibilityHint(String(localized: "Will go to the
demo bank website."))
}
}
.listStyle(myListStyle.style).anyView
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (f361c56 -> 22663e3), gnunet, 2024/12/13
- [taler-taler-ios] 02/05: Debugging, cleanup,
gnunet <=
- [taler-taler-ios] 04/05: German l10n, gnunet, 2024/12/13
- [taler-taler-ios] 03/05: Deposit+bank accounts, w.i.p., gnunet, 2024/12/13
- [taler-taler-ios] 01/05: A11y fixes, gnunet, 2024/12/13
- [taler-taler-ios] 05/05: Bump version to 0.14.0 (0.14.0), gnunet, 2024/12/13