commit ef6d345d0081e4efc21b8a864bf7c9c3ddd39005 parent 660e28ad9dca82c337dc59061c3f94f9377f301a Author: Florian Dold <florian@dold.me> Date: Tue, 2 Jun 2026 00:30:56 +0200 wallet-core: fix bad deletion of some transactions Diffstat:
5 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/packages/taler-wallet-core/src/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/pay-peer-pull-credit.ts @@ -126,7 +126,7 @@ export class PeerPullCreditTransactionContext implements TransactionContext { async updateTransactionMeta(tx: WalletIndexedDbTransaction): Promise<void> { const rec = await tx.peerPullCredit.get(this.pursePub); if (rec == null) { - await tx.transactionsMeta.delete(this.pursePub); + await tx.transactionsMeta.delete(this.transactionId); } else { await tx.transactionsMeta.put({ currency: Amounts.currencyOf(rec.estimatedAmountEffective), diff --git a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts @@ -121,7 +121,7 @@ export class PeerPullDebitTransactionContext implements TransactionContext { async updateTransactionMeta(tx: WalletIndexedDbTransaction): Promise<void> { const rec = await tx.peerPullDebit.get(this.peerPullDebitId); if (rec == null) { - await tx.transactionsMeta.delete(this.peerPullDebitId); + await tx.transactionsMeta.delete(this.transactionId); } else { await tx.transactionsMeta.put({ currency: Amounts.currencyOf(rec.amount), diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -129,7 +129,7 @@ export class PeerPushCreditTransactionContext implements TransactionContext { async updateTransactionMeta(tx: WalletIndexedDbTransaction): Promise<void> { const rec = await tx.peerPushCredit.get(this.peerPushCreditId); if (rec == null) { - await tx.transactionsMeta.delete(this.peerPushCreditId); + await tx.transactionsMeta.delete(this.transactionId); } else { await tx.transactionsMeta.put({ currency: Amounts.currencyOf(rec.estimatedAmountEffective), diff --git a/packages/taler-wallet-core/src/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/pay-peer-push-debit.ts @@ -124,8 +124,9 @@ export class PeerPushDebitTransactionContext implements TransactionContext { async updateTransactionMeta(tx: WalletIndexedDbTransaction): Promise<void> { const rec = await tx.peerPushDebit.get(this.pursePub); + logger.info(`updating peer-push-debit meta for ${j2s(rec)}`); if (rec == null) { - await tx.transactionsMeta.delete(this.pursePub); + await tx.transactionsMeta.delete(this.transactionId); } else { await tx.transactionsMeta.put({ currency: Amounts.currencyOf(rec.amount), diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -535,7 +535,7 @@ type CancelFn = () => void; /** * Incremented each time we want to re-materialize transactions. */ -const MATERIALIZED_TRANSACTIONS_VERSION = 2; +const MATERIALIZED_TRANSACTIONS_VERSION = 3; async function migrateMaterializedTransactions( wex: WalletExecutionContext,