diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-core/src/exchanges.ts | 8 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/shepherd.ts | 27 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/withdraw.ts | 3 |
3 files changed, 25 insertions, 13 deletions
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts index 13c2ca316..05de3d8e5 100644 --- a/packages/taler-wallet-core/src/exchanges.ts +++ b/packages/taler-wallet-core/src/exchanges.ts @@ -1158,7 +1158,7 @@ export async function fetchFreshExchange( } = {}, ): Promise<ReadyExchangeSummary> { logger.info(`fetch fresh ${baseUrl} forced ${options.forceUpdate}`); - + if (!options.forceUpdate) { const cachedResp = wex.ws.exchangeCache.get(baseUrl); if (cachedResp) { @@ -1552,7 +1552,10 @@ export async function updateExchangeFromUrlHandler( r.cachebreakNextUpdate = false; await tx.exchanges.put(r); const drRowId = await tx.exchangeDetails.put(newDetails); - checkDbInvariant(typeof drRowId.key === "number", "exchange details key is not a number"); + checkDbInvariant( + typeof drRowId.key === "number", + "exchange details key is not a number", + ); for (const sk of keysInfo.signingKeys) { // FIXME: validate signing keys before inserting them @@ -2259,7 +2262,6 @@ export async function markExchangeUsed( notif: undefined, }; } - } /** diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts index d662bd7ae..050de479a 100644 --- a/packages/taler-wallet-core/src/shepherd.ts +++ b/packages/taler-wallet-core/src/shepherd.ts @@ -306,6 +306,7 @@ export class TaskSchedulerImpl implements TaskScheduler { const maybeNotification = await this.ws.db.runAllStoresReadWriteTx( {}, async (tx) => { + logger.trace(`storing task [reset] for ${taskId}`); await tx.operationRetries.delete(taskId); return taskToRetryNotification(this.ws, tx, taskId, undefined); }, @@ -325,7 +326,13 @@ export class TaskSchedulerImpl implements TaskScheduler { try { await info.cts.token.racePromise(this.ws.timerGroup.resolveAfter(delay)); } catch (e) { - logger.info(`waiting for ${taskId} interrupted`); + if (e instanceof CancellationToken.CancellationError) { + logger.info( + `waiting for ${taskId} interrupted: ${e.message} ${j2s(e.reason)}`, + ); + } else { + logger.info(`waiting for ${taskId} interrupted: ${e}`); + } } } @@ -363,6 +370,7 @@ export class TaskSchedulerImpl implements TaskScheduler { try { res = await callOperationHandlerForTaskId(wex, taskId); } catch (e) { + logger.trace(`Shepherd error ${taskId} saving response ${e}`); res = { type: TaskRunResultType.Error, errorDetail: getErrorDetailFromException(e), @@ -382,13 +390,11 @@ export class TaskSchedulerImpl implements TaskScheduler { }); switch (res.type) { case TaskRunResultType.Error: { - if (logger.shouldLogTrace()) { - logger.trace( - `Shepherd for ${taskId} got error result: ${j2s( - res.errorDetail, - )}`, - ); - } + // if (logger.shouldLogTrace()) { + logger.trace( + `Shepherd for ${taskId} got error result: ${j2s(res.errorDetail)}`, + ); + // } const retryRecord = await storePendingTaskError( this.ws, taskId, @@ -457,7 +463,7 @@ async function storePendingTaskError( pendingTaskId: string, e: TalerErrorDetail, ): Promise<OperationRetryRecord> { - logger.info(`storing pending task error for ${pendingTaskId}`); + logger.trace(`storing task [pending] with ERROR for ${pendingTaskId}`); const res = await ws.db.runAllStoresReadWriteTx({}, async (tx) => { let retryRecord = await tx.operationRetries.get(pendingTaskId); if (!retryRecord) { @@ -489,6 +495,7 @@ async function storeTaskProgress( ws: InternalWalletState, pendingTaskId: string, ): Promise<void> { + logger.trace(`storing task [progress] for ${pendingTaskId}`); await ws.db.runReadWriteTx( { storeNames: ["operationRetries"] }, async (tx) => { @@ -501,6 +508,7 @@ async function storePendingTaskPending( ws: InternalWalletState, pendingTaskId: string, ): Promise<OperationRetryRecord> { + logger.trace(`storing task [pending] for ${pendingTaskId}`); const res = await ws.db.runAllStoresReadWriteTx({}, async (tx) => { let retryRecord = await tx.operationRetries.get(pendingTaskId); let hadError = false; @@ -541,6 +549,7 @@ async function storePendingTaskFinished( ws: InternalWalletState, pendingTaskId: string, ): Promise<void> { + logger.trace(`storing task [finished] for ${pendingTaskId}`); await ws.db.runReadWriteTx( { storeNames: ["operationRetries"] }, async (tx) => { diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index 0e7ed144c..42adf3585 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -1934,6 +1934,7 @@ async function processWithdrawalGroupPendingReady( "can't get funding uri from uninitialized wg", ); const exchangeBaseUrl = withdrawalGroup.exchangeBaseUrl; + logger.trace(`updating exchange beofre processing wg`) await fetchFreshExchange(wex, withdrawalGroup.exchangeBaseUrl); if (withdrawalGroup.denomsSel.selectedDenoms.length === 0) { @@ -3564,7 +3565,7 @@ async function internalWaitWithdrawalFinal( // Check if refresh is final const res = await ctx.wex.db.runReadOnlyTx( - { storeNames: ["withdrawalGroups", "operationRetries"] }, + { storeNames: ["withdrawalGroups"] }, async (tx) => { return { wg: await tx.withdrawalGroups.get(ctx.withdrawalGroupId), |