diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 5b6b5adc3..0dbbc56c1 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -971,16 +971,25 @@ export async function getTransactions( transactions.push(buildTransactionForPullPaymentDebit(pi)); }); - if (transactionsRequest?.includeRefreshes) { - tx.refreshGroups.iter().forEachAsync(async (rg) => { - if (shouldSkipCurrency(transactionsRequest, rg.currency)) { - return; + tx.refreshGroups.iter().forEachAsync(async (rg) => { + if (shouldSkipCurrency(transactionsRequest, rg.currency)) { + return; + } + let required = false; + const opId = RetryTags.forRefresh(rg); + if (transactionsRequest?.includeRefreshes) { + required = true; + } else if (rg.operationStatus !== RefreshOperationStatus.Finished) { + const ort = await tx.operationRetries.get(opId); + if (ort) { + required = true; } - const opId = RetryTags.forRefresh(rg); + } + if (required) { const ort = await tx.operationRetries.get(opId); transactions.push(buildTransactionForRefresh(rg, ort)); - }); - } + } + }); tx.withdrawalGroups.iter().forEachAsync(async (wsr) => { if (