gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: wallet-core: fix long-polling


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: fix long-polling request parameter
Date: Mon, 19 Feb 2024 23:46:12 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new e0c21a869 wallet-core: fix long-polling request parameter
e0c21a869 is described below

commit e0c21a8694ba1f18b5940fc9ce776cd233610418
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Feb 19 23:46:12 2024 +0100

    wallet-core: fix long-polling request parameter
---
 packages/taler-util/src/taler-types.ts     | 11 +++++++++++
 packages/taler-wallet-core/src/withdraw.ts | 10 +++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/packages/taler-util/src/taler-types.ts 
b/packages/taler-util/src/taler-types.ts
index 4a0c53a79..fe8f47e30 100644
--- a/packages/taler-util/src/taler-types.ts
+++ b/packages/taler-util/src/taler-types.ts
@@ -977,6 +977,8 @@ export class CheckPaymentResponse {
  * Response from the bank.
  */
 export class WithdrawOperationStatusResponse {
+  status: "selected" | "aborted" | "confirmed" | "pending";
+
   selection_done: boolean;
 
   transfer_done: boolean;
@@ -1573,6 +1575,15 @@ export const codecForCheckPaymentResponse = (): 
Codec<CheckPaymentResponse> =>
 export const codecForWithdrawOperationStatusResponse =
   (): Codec<WithdrawOperationStatusResponse> =>
     buildCodecForObject<WithdrawOperationStatusResponse>()
+      .property(
+        "status",
+        codecForEither(
+          codecForConstString("selected"),
+          codecForConstString("confirmed"),
+          codecForConstString("aborted"),
+          codecForConstString("pending"),
+        ),
+      )
       .property("selection_done", codecForBoolean())
       .property("transfer_done", codecForBoolean())
       .property("aborted", codecForBoolean())
diff --git a/packages/taler-wallet-core/src/withdraw.ts 
b/packages/taler-wallet-core/src/withdraw.ts
index 2e05f1221..3f4b3ef70 100644
--- a/packages/taler-wallet-core/src/withdraw.ts
+++ b/packages/taler-wallet-core/src/withdraw.ts
@@ -2262,17 +2262,25 @@ async function processReserveBankStatus(
     `withdrawal-operation/${uriResult.withdrawalOperationId}`,
     uriResult.bankIntegrationApiBaseUrl,
   );
-  url.searchParams.set("timeout_ms", "30000");
+  url.searchParams.set("long_poll_ms", "30000");
 
+  logger.info(`long-polling for withdrawal operation at ${url.href}`);
   const statusResp = await ws.http.fetch(url.href, {
     timeout: getReserveRequestTimeout(withdrawalGroup),
   });
+  logger.info(
+    `long-polling for withdrawal operation returned status 
${statusResp.status}`,
+  );
 
   const status = await readSuccessResponseJsonOrThrow(
     statusResp,
     codecForWithdrawOperationStatusResponse(),
   );
 
+  if (logger.shouldLogTrace()) {
+    logger.trace(`response body: ${j2s(status)}`);
+  }
+
   if (status.aborted) {
     return transitionBankAborted(ctx);
   }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]