diff options
author | Florian Dold <florian@dold.me> | 2024-04-08 22:52:53 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-04-08 22:52:53 +0200 |
commit | ca60e97755d91d73b4f5fc3992ddb2db524cd5f2 (patch) | |
tree | 735fbdf759489191e97bfb38918a8ec0b5fb39bd /packages/taler-wallet-core/src/withdraw.ts | |
parent | 18b77088bfc8699dfff64b70bb65b915f08d0fb6 (diff) | |
download | wallet-core-ca60e97755d91d73b4f5fc3992ddb2db524cd5f2.tar.xz |
wallet-core: fix cancellation
Diffstat (limited to 'packages/taler-wallet-core/src/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/withdraw.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index 68ff9d494..7ec62a46b 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -54,6 +54,7 @@ import { LibtoolVersion, Logger, NotificationType, + ObservabilityEventType, TalerBankIntegrationHttpClient, TalerError, TalerErrorCode, @@ -3167,12 +3168,25 @@ export async function getWithdrawalDetailsForAmount( if (clientCancelKey) { const prevCts = wex.ws.clientCancellationMap.get(clientCancelKey); if (prevCts) { + wex.oc.observe({ + type: ObservabilityEventType.Message, + contents: `Cancelling previous key ${clientCancelKey}`, + }); prevCts.cancel(); + } else { + wex.oc.observe({ + type: ObservabilityEventType.Message, + contents: `No previous key ${clientCancelKey}`, + }); } + wex.oc.observe({ + type: ObservabilityEventType.Message, + contents: `Setting clientCancelKey ${clientCancelKey} to ${cts}`, + }); wex.ws.clientCancellationMap.set(clientCancelKey, cts); } try { - return internalGetWithdrawalDetailsForAmount(wex, req); + return await internalGetWithdrawalDetailsForAmount(wex, req); } finally { if (clientCancelKey && !cts.token.isCancelled) { wex.ws.clientCancellationMap.delete(clientCancelKey); |