From 3daa4dbb3fc5199fb05d58b40c0d7c9ee287595e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 20 Feb 2023 20:14:37 +0100 Subject: wallet-core: fix retryTransaction, improve tx/op identifier parsing/construction --- packages/taler-wallet-core/src/operations/common.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'packages/taler-wallet-core/src/operations/common.ts') diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index 35e6455bc..e5eda074c 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -218,6 +218,23 @@ export async function storeOperationError( }); } +export async function resetOperationTimeout( + ws: InternalWalletState, + pendingTaskId: string, +): Promise { + await ws.db + .mktx((x) => [x.operationRetries]) + .runReadWrite(async (tx) => { + let retryRecord = await tx.operationRetries.get(pendingTaskId); + if (retryRecord) { + // Note that we don't reset the lastError, it should still be visible + // while the retry runs. + retryRecord.retryInfo = RetryInfo.increment(retryRecord.retryInfo); + await tx.operationRetries.put(retryRecord); + } + }); +} + export async function storeOperationPending( ws: InternalWalletState, pendingTaskId: string, -- cgit v1.2.3