summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-04-08 22:52:53 +0200
committerFlorian Dold <florian@dold.me>2024-04-08 22:52:53 +0200
commitca60e97755d91d73b4f5fc3992ddb2db524cd5f2 (patch)
tree735fbdf759489191e97bfb38918a8ec0b5fb39bd /packages/taler-wallet-core
parent18b77088bfc8699dfff64b70bb65b915f08d0fb6 (diff)
downloadwallet-core-ca60e97755d91d73b4f5fc3992ddb2db524cd5f2.tar.gz
wallet-core-ca60e97755d91d73b4f5fc3992ddb2db524cd5f2.tar.bz2
wallet-core-ca60e97755d91d73b4f5fc3992ddb2db524cd5f2.zip
wallet-core: fix cancellation
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/withdraw.ts16
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);