PATCHES.md (10568B)
1 <!-- 2 This file is part of GNU Taler 3 (C) 2026 Taler Systems S.A. 4 5 GNU Taler is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 --> 16 17 # Patches for the findings 18 19 Where a finding has a fix that is clear from the code rather than a product 20 decision, the patch sits beside it as `<finding>.diff`. Each one applies to a 21 clean checkout with 22 23 ```bash 24 git apply simulator/findings/<finding>.diff 25 ``` 26 27 All nineteen apply together, and with all of them applied 28 `./gradlew :wallet:compileFdroidDebugKotlin :wallet:lintFdroidDebug 29 :taler-kotlin-android:testDebugUnitTest` succeeds (lint matters here: it runs 30 with `abortOnError true` and `ignoreWarnings false`). The terminal patch was 31 checked on its own module, `:merchant-terminal:compileDebugKotlin` and 32 `:merchant-terminal:lintDebug`. No two patches touch the same file, with 33 one exception: `release-error-screen-explains-nothing` and 34 `product-image-dialog-has-nothing-to-announce` both add strings to 35 `wallet/src/main/res/values/strings.xml`, in different places, so they apply in 36 either order. 37 38 Fifteen of the nineteen have also **run on a device**. The four that have not 39 are the ones written since that run — the terminal's config scanner, the 40 product-picture labels, the payment prompt's refusal reason, and the second 41 half of the accessible-names patch — which are built and linted but not 42 driven. The set that did run was built into a 43 `sim` APK and put through the sixteen scenarios that touch patched code on one 44 emulator, with its coverage dumps kept apart (JaCoCo keys classes by a hash of 45 their bytecode, so two builds' dumps cannot be merged): 46 47 ``` 48 16 scenarios, 16 ok, 1 findings (1 serious) 49 ``` 50 51 Fifteen of the sixteen reported nothing at all, including the scenarios that 52 produce `fee-on-dead-transaction`, `mixed-amount-notation` and 53 `glued-currency` on an unpatched build. Two wallet-core operations that no 54 scenario could reach before — `getDonauStatements` and 55 `sendTalerUriMailboxMessage`, each behind one of the defects — are exercised by 56 that run. 57 58 The one finding was the patch set's own fault and is now fixed: see "What 59 running it changed" in `release-error-screen-explains-nothing.md`, where the 60 first version of that patch put a wallet-core error-code *name* in front of a 61 release user. The rebuilt patch was re-run on the same scenario and is clean. 62 63 The exceptions are the two camera patches. `qr-camera-ignores-the-plane-strides` 64 carries nine JVM unit tests, including five that encode a real QR code into a 65 synthetic camera frame and decode it back, so the pipeline is verified as far 66 as arithmetic goes — though still not against a real Android 14 camera. 67 `pos-config-scanner-asks-for-a-rotation-zxing-refuses` removes a call that 68 throws unconditionally, which `repro_pos_rotate_unsupported.java` shows in 69 three lines. Both findings list the attended tests that only a human with a 70 phone can run. 71 72 | patch | what it changes | 73 | --- | --- | 74 | `config-change-locks-the-wallet-out-of-its-database` | `MainActivity` starts wallet-core only when it is not already running, which is the asymmetry that caused the 7001 "exclusive ownership" error screen | 75 | `reset-dialog-puts-the-wipe-where-cancel-belongs` | swaps the positive and negative buttons in the reset *and* import dialogs, so the destructive action is drawn on the right | 76 | `payto-link-only-accepts-iban` | `isSupportedPayToUri` delegates to `PaytoUri.parse`, so every target type the app models is accepted | 77 | `mailbox-payment-only-actionable-for-one-scheme` | one `talerUriAction`/`talerUriIsAction` helper in `Utils.kt`, used by the mailbox rows and the forward button instead of two hand-written prefix tests | 78 | `donation-statements-button-is-wired-to-nothing` | threads the donau host through `BalancesPagerComposable` and navigates to `DonauStatement`, with the setup screen as the fallback | 79 | `contacts-and-mailbox-cannot-be-translated` | moves 42 literals into `strings.xml` and references them with `stringResource` | 80 | `amounts-without-currency-specification` | passes the currency specification into the three transfer screens so `transferAmount` is formatted like every other amount | 81 | `aborted-credit-shows-the-whole-amount-as-fee` | adds `Transaction.feeIsMeaningful` and gates the inferred fee row on it in all four credit screens | 82 | `suspended-looks-like-completed-in-the-list` | shows the suspended and expired states in the transaction list, which said nothing for them | 83 | `release-error-screen-explains-nothing` | `userFacingMsg` falls back to the error code when there is neither a hint nor a message | 84 | `action-buttons-have-no-accessible-name` | merges `ActionButton`'s semantics, naming all seven action buttons at once, and names the button that leaves selection mode on the transactions screen | 85 | `mailbox-private-keys-written-to-log` | redacts the keys in `MailboxConfiguration.toString()` and downgrades two `Log.e` traces | 86 | `add-account-note-is-required-but-unmarked` | labels the field "Note (required)", beside the two that say "(optional)" | 87 | `unreachable-host-leaves-blank-retrying-purchase` | permits cleartext to `127.0.0.1` and `::1`, which are the same machine as `localhost` | 88 | `delete-transaction-requeries-deleted-id` | `TransactionManager` remembers the ids it deleted and skips their transition notifications, which is where the three 7052 requests came from | 89 | `payment-prompt-says-insufficient-without-the-reason` | the payment prompt reads `causeHint` like the peer screen already does, so a refusal the merchant caused stops being reported as the user's balance | 90 | `product-image-dialog-has-nothing-to-announce` | names the product thumbnail and the picture dialog, whose window had nothing in its accessibility tree at all | 91 | `qr-camera-ignores-the-plane-strides` | extracts the camera's luminance plane with `rowStride` and `pixelStride` honoured, deletes the hand-rolled rotation zxing never needed, closes the frame whatever happens to it, and moves the analysis off the UI thread — **with nine unit tests** | 92 | `pos-config-scanner-asks-for-a-rotation-zxing-refuses` | the terminal's own copy of that pipeline: drops a `rotateCounterClockwise()` that `PlanarYUVLuminanceSource` answers with `UnsupportedOperationException`, takes the row stride as zxing's `dataWidth`, and closes the frame in a `finally` | 93 94 ## Deliberately not patched 95 96 * **`database-import-reports-only-in-a-toast`** — a snackbar, a dialog or a 97 "last imported" line in the settings would all work; which one fits the app's 98 voice is a product decision, and it should cover export and clear too. 99 * **`withdrawal-screen-never-recovers-from-an-exchange-outage`** — the screen 100 needs an error state and a way to re-prepare; both are design decisions about 101 what a failed withdrawal preparation should look like. 102 * **`multi-qr-transfer-screen-cannot-be-reached`** — the button, the navigation 103 flag and the screen variant are all gated on a transfer option with two QR 104 codes, and wallet-core's two encoders exclude each other by IBAN country. 105 Leaving it for a future encoder, routing the single-QR case through the same 106 screen, or deleting the variant are all defensible. 107 * **`refresh-transactions-are-never-listed`** — the app has the whole detail 108 screen for change transactions but never passes `includeRefreshes`, so 109 wallet-core withholds them. Showing them always, only in developer mode, or 110 only when one has failed is a product decision; the finding lays out the 111 three. 112 * **`dead-declarations-complete-list`** — the systematic list (19 declarations 113 and 383 lines in the wallet, 10 and 56 in the library) and coverage 114 recomputed without them: 80.8 % of reachable lines rather than 79.4 %. 115 Deletion is a decision about intent, per item. 116 * **`ui-with-no-callers`** — about 320 lines that nothing refers to: five 117 pieces of UI (one a second implementation of the add-contact screen) and 118 four helpers in `Utils.kt`, one of which is the only user of the app's two 119 WiFi permissions. Whether each is wired up or deleted is a decision about 120 intent; the unused `CHANGE_WIFI_STATE` is the part worth deciding first. 121 * **`alias-registration-hardcodes-the-directory`** — the fix is a new setting 122 (a `taldirBaseUrl` beside the donau one), which is a product decision about 123 where it belongs and what the default should be, not a mechanical change. 124 * **`a-failed-query-is-shown-as-an-empty-wallet`** and the empty-prompt half of 125 `unreachable-host-leaves-blank-retrying-purchase` — both need a loading and 126 an error state designed into several screens. 127 * **`refresh-fails-on-mixed-age-denominations`**, 128 `deposit-does-not-guard-zero-amounts`, `addglobalcurrencyexchange-null-masterpub` 129 — these are wallet-core (taler-typescript-core), not this repository. 130 * **`taldir-protocol-version-mismatch`** — one character in the taldir service, 131 in its own repository. 132 * **`error-code-registry-behind-wallet-core`** — `TalerErrorCode.kt` is 133 generated from the upstream registry; it wants a regeneration, not an edit. 134 * **`pos-confirmation-shows-five-codes`**, `purge-destroys-coins-and-history-without-saying-so`, 135 `wallet-lock-opens-when-the-credential-is-gone`, 136 `unknown-wire-method-hangs-the-deposit-form`, 137 `bitcoin-transfer-relabels-the-amount-as-btc`, 138 `dev-experiment-uri-exits-the-app`, 139 `add-payment-service-fails-silently`, 140 `word-currency-symbol-glued-to-amount` — each needs a decision I would be 141 guessing at: which TOTP code is the right one to show, what a purge should 142 warn, whether an absent credential should lock or open, and so on. The 143 findings say what is wrong and where; the choice is the maintainer's. 144 * **`contacts-and-mailbox-cannot-be-translated`** covers 42 of the 43 strings. 145 The last one, `ContactManager.kt:169`'s "Alias not found", is built into a 146 `TalerErrorInfo.message` by a class that has no `Context`; localising it 147 means mapping the code at the display site instead, which is a small design 148 choice rather than a substitution.