diff options
author | Florian Dold <florian@dold.me> | 2023-02-20 20:14:37 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-02-20 20:14:46 +0100 |
commit | 3daa4dbb3fc5199fb05d58b40c0d7c9ee287595e (patch) | |
tree | bdf3bcd9af71ce9cc77a8c4dc32ff0537654e83f /packages/taler-wallet-core/src/wallet.ts | |
parent | 7bb81a008b7148cfd3fd656f858e4cbd755531ac (diff) | |
download | wallet-core-3daa4dbb3fc5199fb05d58b40c0d7c9ee287595e.tar.xz |
wallet-core: fix retryTransaction, improve tx/op identifier parsing/construction
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index a036be86c..47724efdc 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -265,7 +265,7 @@ import { GetReadOnlyAccess, GetReadWriteAccess, } from "./util/query.js"; -import { OperationAttemptResult, RetryTags } from "./util/retries.js"; +import { OperationAttemptResult, TaskIdentifiers } from "./util/retries.js"; import { TimerAPI, TimerGroup } from "./util/timer.js"; import { WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, @@ -306,17 +306,15 @@ async function callOperationHandler( forceNow, }); case PendingTaskType.Refresh: - return await processRefreshGroup(ws, pending.refreshGroupId, { - forceNow, - }); + return await processRefreshGroup(ws, pending.refreshGroupId); case PendingTaskType.Withdraw: return await processWithdrawalGroup(ws, pending.withdrawalGroupId, { forceNow, }); case PendingTaskType.TipPickup: - return await processTip(ws, pending.tipId, { forceNow }); + return await processTip(ws, pending.tipId); case PendingTaskType.Purchase: - return await processPurchase(ws, pending.proposalId, { forceNow }); + return await processPurchase(ws, pending.proposalId); case PendingTaskType.Recoup: return await processRecoupGroupHandler(ws, pending.recoupGroupId, { forceNow, @@ -324,9 +322,7 @@ async function callOperationHandler( case PendingTaskType.ExchangeCheckRefresh: return await autoRefresh(ws, pending.exchangeBaseUrl); case PendingTaskType.Deposit: { - return await processDepositGroup(ws, pending.depositGroupId, { - forceNow, - }); + return await processDepositGroup(ws, pending.depositGroupId); } case PendingTaskType.Backup: return await processBackupForProvider(ws, pending.backupProviderBaseUrl); @@ -691,7 +687,7 @@ async function getExchanges( for (const r of exchangeRecords) { const exchangeDetails = await getExchangeDetails(tx, r.baseUrl); const opRetryRecord = await tx.operationRetries.get( - RetryTags.forExchangeUpdate(r), + TaskIdentifiers.forExchangeUpdate(r), ); exchanges.push( makeExchangeListItem(r, exchangeDetails, opRetryRecord?.lastError), @@ -1285,9 +1281,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( RefreshReason.Manual, ); }); - processRefreshGroup(ws, refreshGroupId.refreshGroupId, { - forceNow: true, - }).catch((x) => { + processRefreshGroup(ws, refreshGroupId.refreshGroupId).catch((x) => { logger.error(x); }); return { @@ -1753,6 +1747,7 @@ class InternalWalletStateImpl implements InternalWalletState { for (const key of Object.keys(this.activeLongpoll)) { logger.trace(`cancelling active longpoll ${key}`); this.activeLongpoll[key].cancel(); + delete this.activeLongpoll[key]; } } |