commit c4b454a9d726dbb16e3a366107b593f4afd7fd62
parent 63ee75405649671ba35483d54bdbc12cdd9a4b40
Author: Florian Dold <florian@dold.me>
Date: Tue, 12 May 2026 16:23:46 +0200
wallet-core: retry info must have non-zero counter to be considered a failed exchange entry update
Diffstat:
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -1264,6 +1264,7 @@ export async function requireExchangeReadyTx(
if (
AbsoluteTime.isExpired(timestampAbsoluteFromDb(exchange.nextUpdateStamp))
) {
+ logger.warn(`exchange ${exchangeBaseUrl} outdated`);
throw new OutdatedExchangeError("exchange entry outdated", exchangeBaseUrl);
}
}
@@ -1414,7 +1415,11 @@ async function waitReadyExchange(
}
break;
case ExchangeEntryDbUpdateStatus.UnavailableUpdate: {
- if (!options.noBail) {
+ if (
+ !options.noBail &&
+ retryInfo &&
+ retryInfo.retryInfo.retryCounter > 1
+ ) {
throw TalerError.fromDetail(
TalerErrorCode.WALLET_EXCHANGE_UNAVAILABLE,
{
@@ -1427,7 +1432,11 @@ async function waitReadyExchange(
}
case ExchangeEntryDbUpdateStatus.OutdatedUpdate:
default: {
- if (retryInfo && !options.noBail) {
+ if (
+ !options.noBail &&
+ retryInfo &&
+ retryInfo.retryInfo.retryCounter > 1
+ ) {
throw TalerError.fromDetail(
TalerErrorCode.WALLET_EXCHANGE_UNAVAILABLE,
{
diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts
@@ -752,8 +752,6 @@ async function taskToRetryNotification(
switch (parsedTaskId.tag) {
case PendingTaskType.ExchangeUpdate:
- case PendingTaskType.ExchangeWalletKyc:
- case PendingTaskType.ExchangeAutoRefresh:
return makeExchangeRetryNotification(ws, tx, pendingTaskId, e);
case PendingTaskType.PeerPullCredit:
case PendingTaskType.PeerPullDebit:
@@ -767,6 +765,8 @@ async function taskToRetryNotification(
case PendingTaskType.Recoup:
case PendingTaskType.ValidateDenoms:
case PendingTaskType.CleanupExpiredTransactions:
+ case PendingTaskType.ExchangeWalletKyc:
+ case PendingTaskType.ExchangeAutoRefresh:
return undefined;
default:
assertUnreachable(parsedTaskId);
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
@@ -2819,6 +2819,7 @@ async function handleTxRetries<T>(
wex.dbRetryState.retriedExchangeUpdate.add(url);
await fetchFreshExchange(wex, url);
await updateWithdrawalDenomsForExchange(wex, url);
+ logger.info(`updated exchange, continuing with transaction retry`);
}
}
}