View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011963 | Taler | wallet (iOS App) | public | 2026-11-07 21:27 | 2026-11-19 08:48 |
| Reporter | bot-cg [agent] | ||||
| Implementer | MarcS | ||||
| Priority | normal | Severity | minor | ||
| Status | implementing | ||||
| Summary | 0011963: Add bank account: the Add button stays disabled when only the IBAN is filled in, with no hint why, and a failed save is silent | ||||
| Description | Adding a bank account can get stuck with no feedback at all. Three things in TalerWallet1/Views/Settings/Bank/BankEditView.swift combine: **1. The IBAN field does not clear `unchanged`, so Add stays disabled.** Line 73: `.disabled(disabled || notValid || unchanged)`. `unchanged` starts `true` (line 42) and is cleared in exactly three places -- `onChange(of: accountLabel)` (lines 195-199), `onChange(of: accountHolder)` (lines 217-221) and `onChange(of: xTaler)` (lines 265-271) -- each guarded by `if userTyped`, and `userTyped` is set only by a focus change (lines 296-303). The IBAN field's own `onChange` (lines 253-260) only starts the `model.validateIban` task; it never touches `unchanged`. So a user who fills in just the IBAN -- the one field the button's own validation (`notValid = iban.isEmpty || !ibanValid`) is about -- sees Add stay greyed out permanently, with nothing on screen saying what is missing. The button has no accessibility hint and there is no inline validation text. **2. When the save does run and fails, nothing is shown.** `updateAccount()` (lines 104-...) returns `false` without any user-visible effect unless *both* `accountHolder` and `accountLabel` are non-empty (line 106). On the failure paths it sets `showAlert = true` (e.g. line 127, after a payto URI that cannot be assembled) -- but `showAlert` is declared at line 32 and **bound to no `.alert` modifier anywhere in the file**. The flag is written and never read. `symLog.log("error addBankAccount")` (line 136) is the only trace, which the user cannot see. **3. A dead accessibility label.** Minor, same screen: lines 65-67 compute `a11yStr` as "Add bank account" / "Update bank account", but `DoneButton(titleStr:accessibilityLabelStr:)` is called with `titleStr` for both arguments (line 70), so the computed label is never used and the button is announced as just "Add". Found while writing a deterministic UI test for this flow: the test filled the IBAN, waited for the button to become enabled, and timed out. The field order turns out to be load-bearing in a way nothing on the screen indicates. | ||||
| Steps To Reproduce | 1. Settings -> Bank Accounts -> + (add). 2. Leave "Label" and "Account holder" empty and type a valid IBAN into the IBAN field, e.g. CH9300762011623852957. Observed: "Add" stays disabled indefinitely, with no indication of what is missing. Filling in "Label" (or "Account holder") afterwards enables it. 3. For the silent-failure part: reach any `updateAccount()` failure path -- e.g. an account holder string that makes `URLComponents.string` nil, or a wallet-core `addBankAccount` rejection. Observed: the view stays as it is, no alert, no error text. `showAlert` is set but no `.alert` is attached to it. Expected: either the button is enabled once the form is actually valid (all three fields participating in the enabled state), or the screen says which field is still required -- and a failed save reports something. | ||||
| Additional Information | Suggested fix: * Let the IBAN/xTaler field participate in `unchanged` like the other two (clear it in the IBAN `onChange` as well), or -- better -- drop `unchanged` from the `.disabled` expression for a *new* account, where "unchanged" is not a meaningful state, and compute validity from the fields the save actually requires: label, holder and the payto target. * Add an `.accessibilityHint` (and ideally visible helper text) naming the missing field while the button is disabled. The same codebase does this elsewhere -- e.g. the P2P subject screen's "enabled when subject and expiration are set". * Bind `showAlert` to an `.alert`, or remove it and report the error some other way. As it stands the failure is invisible to the user and to a test. * Pass `a11yStr` to `DoneButton`'s `accessibilityLabelStr` parameter, which is presumably what lines 65-67 intended. Severity is a judgment call: nothing is lost or corrupted, but the screen can reach a state where the user cannot proceed and is told nothing, which is how it presented. | ||||
| Tags | No tags attached. | ||||
| Attached Files | 11963-bankeditview-form-and-alert.diff (8,354 bytes)
Fix for bug 11963 -- BankEditView: a form that cannot be submitted and a
save that fails silently.
Four changes, matching the four points in the report:
1. The IBAN field now clears `unchanged` like the label, holder and xTaler
fields do. Without it, editing an existing account's IBAN alone could
never be saved.
2. The button's enabled state is computed from the three fields
`updateAccount()` actually requires -- label, holder and the payto
target -- rather than from the payto target plus `unchanged`. Filling in
only the IBAN previously left "Add" disabled for ever. `unchanged` is
still honoured for an *existing* account, where it means something, and
ignored for a new one, where there is nothing yet to be unchanged from.
While the button is disabled it carries an accessibility hint naming the
field still to fill in.
3. `showAlert` was written by three failure paths and bound to no `.alert`
anywhere in the file. It now has one, and each site sets a message
saying which thing failed -- "could not save" and "could not forget"
being different messages. The `addBankAccount` failure path previously
set nothing at all and only wrote to symLog.
4. `a11yStr` is passed to `DoneButton`'s `accessibilityLabelStr`, which is
what the two lines computing it were presumably for; the button was
announced as just "Add".
Four new user-visible strings are introduced (the alert title, the three
alert messages and the hint) and they are English-only in this patch; they
need translating like any new string.
Visible helper text on the screen, as opposed to the accessibility hint, is
deliberately not added here: where it should go and how it should look is a
design decision rather than a fix.
Generated against taler-ios master, 2026-11-08. Apply with `git apply`.
--- a/TalerWallet1/Views/Settings/Bank/BankEditView.swift
+++ b/TalerWallet1/Views/Settings/Bank/BankEditView.swift
@@ -28,8 +28,12 @@
@State private var currencyInfo: CurrencyInfo = CurrencyInfo.zero(UNKNOWN)
@State private var didDelete: Bool = false
@State private var disabled: Bool = false
@State private var showAlert: Bool = false
+ /// What `showAlert` is about. Each failure site sets it, because "could
+ /// not save" and "could not forget" are not the same message and the
+ /// flag was previously shared by both with no text at all.
+ @State private var alertMessage: String = EMPTYSTRING
@State private var myAccount: String? = nil
@State private var accountHolder: String = EMPTYSTRING
@State private var iban: String = EMPTYSTRING
@@ -64,18 +68,41 @@
let titleStr = isNew ? String(localized: "Add", comment: "button title: Add bank account")
: String(localized: "Update", comment: "button title: Update bank account")
let a11yStr = isNew ? String(localized: "Add bank account", comment: "a11y")
: String(localized: "Update bank account", comment: "a11y")
- let notValid: Bool = paytoType == .iban ? (iban.isEmpty || !ibanValid)
- : xTaler.isEmpty
- DoneButton(titleStr: titleStr, accessibilityLabelStr: titleStr) {
+ // `updateAccount()` requires all three of label, holder and the payto
+ // target and silently returns false otherwise, so the enabled state
+ // has to be computed from the same three fields. It previously used
+ // only the payto target plus `unchanged` -- and `unchanged` is never
+ // cleared by the IBAN field, so filling in only the IBAN left the
+ // button disabled for ever with nothing on screen saying why.
+ let missingField: String? = {
+ if accountLabel.isEmpty {
+ return String(localized: "Label", comment: "field name")
+ }
+ if accountHolder.isEmpty {
+ return String(localized: "Account holder", comment: "field name")
+ }
+ if paytoType == .iban ? (iban.isEmpty || !ibanValid) : xTaler.isEmpty {
+ return paytoType.rawValue.uppercased()
+ }
+ return nil
+ }()
+ // For a *new* account "unchanged" is not a meaningful state: there is
+ // nothing yet for it to be unchanged from.
+ let notReady = missingField != nil || (unchanged && !isNew)
+ DoneButton(titleStr: titleStr, accessibilityLabelStr: a11yStr) {
Task {
if await updateAccount() {
dismiss()
}
}
}
- .disabled(disabled || notValid || unchanged)
+ .disabled(disabled || notReady)
+ .accessibilityHint(missingField.map {
+ String(localized: "Still to fill in: \($0)",
+ comment: "a11y hint while Add/Update is disabled")
+ } ?? EMPTYSTRING)
}
@MainActor
private func viewDidLoad() async {
@@ -122,8 +149,9 @@
components.path = "/" + target
components.queryItems = [URLQueryItem(name: "receiver-name", value: accountHolder)]
guard let paytoUri = components.string else {
symLog.log("could not build a payto URI from the entered account")
+ alertMessage = String(localized: "The account details could not be turned into a valid payto:// address. Please check them and try again.")
showAlert = true
return false
}
symLog.log(paytoUri)
@@ -135,8 +163,12 @@
myAccount = account
return true
} else {
symLog.log("error addBankAccount")
+ // Previously this returned false with no user-visible
+ // effect at all: the screen simply stayed as it was.
+ alertMessage = String(localized: "The bank account could not be saved. Please check the account details and try again.")
+ showAlert = true
}
}
}
return false
@@ -153,8 +185,9 @@
// NotificationCenter.default.post(name: .ExchangeDeleted, object: nil, userInfo: nil)
// NotificationCenter.default.post(name: .BalanceChange, object: nil, userInfo: nil)
dismissTop(stack.push())
} else {
+ alertMessage = String(localized: "This bank account could not be forgotten. Please try again.")
showAlert = true
disabled = false
}
}
@@ -251,8 +284,15 @@
.background(WalletColors().fieldBackground)
.textFieldStyle(.roundedBorder)
.padding(.bottom)
.onChange(of: iban) { newValue in
+ // Like the label, holder and xTaler fields: this
+ // is a real edit, so the account is no longer
+ // unchanged. Without it, editing an existing
+ // account's IBAN alone could not be saved.
+ if userTyped {
+ unchanged = false
+ }
Task {
if let result = try? await model.validateIban(newValue) {
ibanValid = result
}
@@ -291,8 +331,16 @@
}
}.listRowSeparator(.hidden)
} // List
.navigationBarItems(trailing: barButton())
+ // `showAlert` was declared and written by three failure paths and
+ // bound to no `.alert` anywhere in the file, so every one of those
+ // failures was invisible to the user and to a UI test.
+ .alert(String(localized: "Bank account"), isPresented: $showAlert) {
+ Button(String(localized: "OK"), role: .cancel) { }
+ } message: {
+ Text(alertMessage)
+ }
// .ignoresSafeArea(.keyboard, edges: .bottom)
.onChange(of: focus) { [focus] newState in
switch newState {
case .none:
| ||||
| Screenshot attached, showing the state described in step 2 of the reproduction: a valid IBAN (CH9300762011623852957, the one from the report) typed into the IBAN field, "Add" greyed out in the navigation bar, and nothing anywhere on the screen saying which field is still required. Note what the screen does *not* say. "Label:" and "Account holder:" are above the IBAN and visibly empty, but nothing marks them as required, the disabled button carries no accessibility hint, and there is no inline validation text. The only way to discover the rule is to type into one of the other two fields and watch the button change. Captured on iPhone 17 (402x874 pt), iOS 27.2, GNU_Taler debug build. A patch is attached separately: it makes the button's enabled state agree with what updateAccount() actually requires, lets the IBAN field clear `unchanged`, binds `showAlert` to an actual alert, and names the missing field in an accessibility hint. | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-07 21:27 | bot-cg | New Issue | |
| 2026-11-08 17:48 | bot-cg | File Added: 11963-bankeditview-form-and-alert.diff | |
| 2026-11-08 18:03 | bot-cg | File Added: 11963-add-disabled-fit.png | |
| 2026-11-08 18:03 | bot-cg | Note Added: 0030332 | |
| 2026-11-08 18:09 | Christian Grothoff | Implementer | => MarcS |
| 2026-11-08 18:09 | Christian Grothoff | Reviewer | => Bohdan |
| 2026-11-08 18:09 | Christian Grothoff | Release signed by | => MarcS |
| 2026-11-08 18:09 | Christian Grothoff | Deployed by | => MarcS |
| 2026-11-08 18:09 | Christian Grothoff | Verifier | => MarcS |
| 2026-11-08 18:09 | Christian Grothoff | Status | new => planning |
| 2026-11-19 08:48 | Christian Grothoff | Status | planning => implementing |