View Issue Details

IDProjectCategoryView StatusLast Update
0012157Talerwallet (iOS App)public2026-11-16 12:16
Reporterbot-cg [agent]  
PrioritynormalSeveritymajor 
Status new 
Summary0012157: Withdrawal (bank-integrated): first contact with a payment service can show currency "UNKNOWN", skip the terms of service and offer "Confirm Withdrawal"
DescriptionScanning or opening a bank-integrated withdrawal link (taler://withdraw/...)
for a payment service the wallet has never contacted can show the withdrawal
sheet in a half-loaded state that it never leaves:

  - the currency is shown as "UNKNOWN",
  - the "You must first accept the payment service's terms" step is missing,
  - "Confirm Withdrawal" is offered at once.

See withdraw-unknown-before.jpg. The sheet stays like this (observed for 60 s).

Reproduction (iOS simulator, iOS 27.2, master of 2026-11-15, fresh wallet):
open a taler://withdraw/ link whose bank suggests a payment service not yet
known to the wallet. With a test exchange that offers ~150 denominations this
happened in 3 of 3 attempts; with smaller ones only occasionally (seen twice
in earlier fuzzing runs), so it is a race against the first /keys download.

Cause (TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift):
the view is handed an Exchange entry that was read (getExchangeEntryByUrl)
before wallet-core has fetched the payment service. That entry has
scopeInfo.currency "UNKNOWN", exchangeUpdateStatus not "ready" and
tosStatus "missing-tos". The view computes

    let tosAccepted = exchange2.tosStatus == .accepted
                   || exchange2.tosStatus == .missingTos // no ToS to accept

so "not known yet" is taken for "nothing to accept". viewDidLoad() then calls
getWithdrawalDetailsForAmount (which makes wallet-core fetch the service), but
the entry is never read again: .task is keyed on exchange?.id, which does not
change. From the app log of a failing run:

    "id":10 prepareBankIntegratedWithdrawal ... took 168 ms
    "id":16 getCurrencySpecification{"scope":{"currency":"UNKNOWN", ...}}
    "id":17 getWithdrawalDetailsForAmount{"amount":"EUR:10", ...} took 29 ms
    (no further request)

Consequence: the user can confirm a withdrawal without ever being shown the
terms of service. I did not press "Confirm Withdrawal" in the runs above; the
"terms of service not accepted" errors (7037) that earlier fuzzing runs logged
after Confirm on first-contact withdrawals probably have this origin, but that
link is an inference, not something I traced.

Proposed patch (attached, withdraw-unknown-exchange.diff): read the entry
again after getWithdrawalDetailsForAmount when it was not "ready", and accept
"missing-tos" as "no terms" only once the payment service has been fetched.
Tested: with the patch the same link shows the terms step, then the amount in
EUR, and the withdrawal proceeds to "Authorize at Bank"
(withdraw-unknown-after.jpg); a second scenario against another new exchange
(withdraw, then pay) also ran through. 2 of 2 with the patch, 3 of 3 failing
without. Not tested: an exchange that genuinely has no terms.

Found by the UI fuzzing harness (branch dev/bot-cg/fuzzbang, scenario fund-eur).
TagsNo tags attached.
Attached Files
withdraw-unknown-before.jpg (14,084 bytes)   
withdraw-unknown-before.jpg (14,084 bytes)   
withdraw-unknown-after.jpg (25,771 bytes)   
withdraw-unknown-after.jpg (25,771 bytes)   
12157-withdraw-unknown-exchange.diff (2,375 bytes)   
diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
index c0cb7a66..d1ec1304 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
@@ -45,6 +45,13 @@ struct WithdrawAcceptView: View {
                                                                      scope: nil) { // TODO: scope
                 withdrawalDetails = details
             }
+            // The exchange entry this view was handed may have been read before wallet-core
+            // had contacted that payment service for the first time: its currency is then
+            // "UNKNOWN" and its tosStatus "missing-tos". Asking for the withdrawal details
+            // makes wallet-core fetch it, so read the entry again now that it is known.
+            if exchange.exchangeUpdateStatus != .ready {
+                await reloadExchange()
+            }
 //          agePicker.setAges(ages: details?.ageRestrictionOptions)
         } else {    // TODO: error
             symLog.log("no exchangeBaseUrl or no exchange")
@@ -60,8 +67,13 @@ struct WithdrawAcceptView: View {
         ZStack {  // there is only _one_ Z item ever - use ZStack to ensure .task is run only _once_ when exchange is switched
           if let exchange2 = exchange {     // there should always be an exchange...
             VStack {
+                // "no ToS to accept" can only be believed once the payment service has been
+                // fetched; before that, missing-tos merely means "not known yet", and treating
+                // it as accepted skipped the terms and offered "Confirm Withdrawal" at once
+                let isFetched = exchange2.exchangeUpdateStatus == .ready
+                             || exchange2.exchangeUpdateStatus == .readyUpdate
                 let tosAccepted = exchange2.tosStatus == .accepted
-                               || exchange2.tosStatus == .missingTos      // no ToS to accept
+                               || (exchange2.tosStatus == .missingTos && isFetched)     // no ToS to accept
                 if !tosAccepted {
                     ToSButtonView(stack: stack.push(),
                         exchangeBaseUrl: exchange2.exchangeBaseUrl,

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Issue History

Date ModifiedUsernameFieldChange
2026-11-16 12:16bot-cgNew Issue
2026-11-16 12:16bot-cgImplementer => MarcS
2026-11-16 12:16bot-cgReviewer => avalos
2026-11-16 12:16bot-cgDeployed by => mikolai
2026-11-16 12:16bot-cgVerifier => Bohdan
2026-11-16 12:16bot-cgCommunicator => CM_7
2026-11-16 12:16bot-cgFile Added: withdraw-unknown-before.jpg
2026-11-16 12:16bot-cgFile Added: withdraw-unknown-after.jpg
2026-11-16 12:16bot-cgFile Added: 12157-withdraw-unknown-exchange.diff