From 57000c22141afde7eb7b13ccbd16f06d6b6eb5cd Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Aug 2020 11:59:06 +0530 Subject: add auto-refund test case, fix bug detected by it --- packages/taler-wallet-core/src/operations/refresh.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/taler-wallet-core/src/operations/refresh.ts') diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index 409ae58cc..430675328 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -571,10 +571,19 @@ export async function createRefreshGroup( retryInfo: initRetryInfo(), }; + if (oldCoinPubs.length == 0) { + logger.warn("created refresh group with zero coins"); + refreshGroup.timestampFinished = getTimestampNow(); + } + await tx.put(Stores.refreshGroups, refreshGroup); logger.trace(`created refresh group ${refreshGroupId}`); + processRefreshGroup(ws, refreshGroupId).catch((e) => { + logger.warn(`processing refresh group ${refreshGroupId} failed`); + }); + return { refreshGroupId, }; -- cgit v1.2.3