taler-typescript-core

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

commit 51823f82855ed2e778c311ca96a7a1fe8bc4f7df
parent aa1e6d5896cf874c2d7e93d2e56c6c1c8cd2991a
Author: Florian Dold <florian@dold.me>
Date:   Mon, 17 Nov 2025 13:06:52 +0100

wallet-core: fix pay-merchant tx deletion

Diffstat:
Mpackages/taler-wallet-core/src/common.ts | 2++
Mpackages/taler-wallet-core/src/pay-merchant.ts | 1+
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/common.ts b/packages/taler-wallet-core/src/common.ts @@ -1103,6 +1103,7 @@ export async function getGenericRecordHandle<T>( tx: WalletDbReadWriteTransaction<any>, getRec: () => Promise<T | undefined>, storeRec: (r: T) => Promise<void>, + deleteRec: () => Promise<void>, toSt: (r: T) => TransactionState, toStId: (r: T) => number, updateMeta: () => Promise<void>, @@ -1127,6 +1128,7 @@ export async function getGenericRecordHandle<T>( } else if (rec != null) { newTxState = { major: TransactionMajorState.Deleted }; newStId = -1; + await deleteRec(); } else { // Neither old or new record. Nothing to do. return; diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts @@ -587,6 +587,7 @@ export class PayMerchantTransactionContext implements TransactionContext { async (r) => { await tx.purchases.put(r); }, + async () => tx.purchases.delete(this.proposalId), (r) => computePayMerchantTransactionState(r), (r) => r.purchaseStatus, () => this.updateTransactionMeta(tx),