taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 1a7a4325775d6b2ee4a0f1762733a1e7b288c1f0
parent 1b732e5afc4cecf7ab7bfb5b9b4df8fe40af3aae
Author: Florian Dold <dold@taler.net>
Date:   Sun, 19 Jul 2026 22:15:42 +0200

db: do not re-activate refresh groups that already finished

Diffstat:
Mpackages/taler-wallet-core/src/db-indexeddb.ts | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/db-indexeddb.ts b/packages/taler-wallet-core/src/db-indexeddb.ts @@ -171,6 +171,8 @@ import { WalletRewardCoinSource, RefundReason, ExchangeMigrationReason, + OPERATION_STATUS_NONFINAL_FIRST, + OPERATION_STATUS_NONFINAL_LAST, } from "./db-common.js"; export { DenomFees, CoinSourceType, RefundReason, ExchangeMigrationReason }; import { @@ -1698,6 +1700,19 @@ async function fixup20260116BadRefreshCoinSelection( tx: WalletIndexedDbTransaction, ): Promise<void> { await tx.refreshGroups.iter().forEachAsync(async (rec) => { + // Only repair groups that are still in flight. "Input non-zero, output + // zero" also describes a refresh that legitimately finished with its + // whole input eaten by fees -- a dust refresh of TESTKUDOS:0.01 into + // nothing looks identical to the bad coin selection this repairs. + // Re-activating one of those undoes a completed operation, which showed + // up as a finished refresh transaction reverting to pending after an + // import. + if ( + rec.operationStatus < OPERATION_STATUS_NONFINAL_FIRST || + rec.operationStatus > OPERATION_STATUS_NONFINAL_LAST + ) { + return; + } const inputAmount = Amounts.sumOrZero( rec.currency, rec.inputPerCoin,