View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012157 | Taler | wallet (iOS App) | public | 2026-11-16 12:16 | 2026-11-18 16:03 |
| Reporter | bot-cg [agent] | ||||
| Implementer | MarcS | ||||
| Priority | normal | Severity | major | ||
| Status | implementing | ||||
| Target Version | 1.7 | ||||
| Summary | 0012157: Withdrawal (bank-integrated): first contact with a payment service can show currency "UNKNOWN", skip the terms of service and offer "Confirm Withdrawal" | ||||
| Description | Scanning 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). | ||||
| Tags | No tags attached. | ||||
| Attached Files | 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,
| ||||
| Rechecked against master 42075050 (1.6.19): STILL PRESENT, with a slightly different appearance. Upstream changed this code (854145e9 "use cached exchanges"): WithdrawAcceptView now re-reads the payment service entry when the controller's cache changes. That helps in some runs and not in others. On an unpatched 1.6.19 build, three scenarios opened a bank-integrated withdrawal at a payment service the wallet had never contacted: - EUR exchange, fresh wallet: terms step shown, withdrawal fine; - HARNESSCOIN exchange, fresh wallet: terms step shown, withdrawal fine; - EUR exchange, wallet that already held KUDOS: the sheet shows only the host name and "Confirm Withdrawal" -- no amount, no currency, no terms step -- and stays that way (screenshot withdraw-1.6.19-no-tos-no-amount.jpg, taken 90 s after the sheet opened). So 1 of 3, where the previous master failed 3 of 3. The predicate the report blames is unchanged (WithdrawAcceptView.swift: `tosAccepted = tosStatus == .accepted || tosStatus == .missingTos`), so whenever the entry is still the unfetched one, "Confirm Withdrawal" is offered without the terms. The attached patch (reload after getWithdrawalDetailsForAmount; believe missing-tos only once the entry is fetched) still applies cleanly to 42075050 and is what the fuzzing branch runs with. | |
| Correction to my note above: the third run did NOT start from a wallet that already held KUDOS. I checked the scenario: it starts from a fresh wallet and opens the same kind of EUR withdrawal as the first one. So the accurate statement is: two fresh-wallet withdrawals at the same EUR exchange on unpatched 1.6.19, one showed the terms step and one showed the bare "Confirm Withdrawal" sheet in the screenshot; a third at another exchange was fine. Same start, different outcome -- which fits a race against the first /keys download. | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-16 12:16 | bot-cg | New Issue | |
| 2026-11-16 12:16 | bot-cg | Implementer | => MarcS |
| 2026-11-16 12:16 | bot-cg | Reviewer | => avalos |
| 2026-11-16 12:16 | bot-cg | Deployed by | => mikolai |
| 2026-11-16 12:16 | bot-cg | Verifier | => Bohdan |
| 2026-11-16 12:16 | bot-cg | Communicator | => CM_7 |
| 2026-11-16 12:16 | bot-cg | File Added: withdraw-unknown-before.jpg | |
| 2026-11-16 12:16 | bot-cg | File Added: withdraw-unknown-after.jpg | |
| 2026-11-16 12:16 | bot-cg | File Added: 12157-withdraw-unknown-exchange.diff | |
| 2026-11-17 09:23 | Christian Grothoff | Release signed by | => MarcS |
| 2026-11-17 09:23 | Christian Grothoff | Target Version | => 1.7 |
| 2026-11-17 09:24 | Christian Grothoff | Status | new => implementing |
| 2026-11-18 16:03 | bot-cg | Note Added: 0030593 | |
| 2026-11-18 16:03 | bot-cg | File Added: withdraw-1.6.19-no-tos-no-amount.jpg | |
| 2026-11-18 16:03 | bot-cg | Note Added: 0030595 |