gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (ffeac825d -> a3c7da975)


From: gnunet
Subject: [taler-wallet-core] branch master updated (ffeac825d -> a3c7da975)
Date: Tue, 21 Feb 2023 20:31:33 +0100

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

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

    from ffeac825d bump to 0.9.3-dev.1
     new 267714074 wallet-core: do not retry transaction if long-poll is active
     new a3c7da975 wallet-core: fix peer-pull-credit long-polling and 
peer-pull-debit pending operation status

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-wallet-core/src/operations/pay-peer.ts | 14 ++++++++++++--
 packages/taler-wallet-core/src/operations/pending.ts  |  9 +++++++--
 packages/taler-wallet-core/src/wallet.ts              |  4 ++--
 3 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts 
b/packages/taler-wallet-core/src/operations/pay-peer.ts
index 5178839a4..8bde47df4 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer.ts
@@ -1155,7 +1155,7 @@ export async function acceptIncomingPeerPullPayment(
  * Look up information about an incoming peer pull payment.
  * Store the results in the wallet DB.
  */
-export async function preparePeerPullCredit(
+export async function preparePeerPullDebit(
   ws: InternalWalletState,
   req: PreparePeerPullDebitRequest,
 ): Promise<PreparePeerPullDebitResponse> {
@@ -1279,7 +1279,7 @@ export async function queryPurseForPeerPullCredit(
   cancellationToken: CancellationToken,
 ): Promise<LongpollResult> {
   const purseDepositUrl = new URL(
-    `purses/${pullIni.pursePub}/merge`,
+    `purses/${pullIni.pursePub}/deposit`,
     pullIni.exchangeBaseUrl,
   );
   purseDepositUrl.searchParams.set("timeout_ms", "30000");
@@ -1372,6 +1372,16 @@ export async function processPeerPullCredit(
     pursePub,
   });
 
+  // We're already running!
+  if (ws.activeLongpoll[retryTag]) {
+    logger.info("peer-pull-credit already in long-polling, returning!");
+    return {
+      type: OperationAttemptResultType.Longpoll,
+    };
+  }
+
+  logger.trace(`processing ${retryTag}, status=${pullIni.status}`);
+
   switch (pullIni.status) {
     case PeerPullPaymentInitiationStatus.PurseDeposited: {
       // We implement this case so that the "retry" action on a 
peer-pull-credit transaction
diff --git a/packages/taler-wallet-core/src/operations/pending.ts 
b/packages/taler-wallet-core/src/operations/pending.ts
index 458448b31..5e14721f8 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -390,8 +390,13 @@ async function gatherPeerPullDebitPending(
   resp: PendingOperationsResponse,
 ): Promise<void> {
   await tx.peerPullPaymentIncoming.iter().forEachAsync(async (pi) => {
-    if (pi.status === PeerPullPaymentIncomingStatus.Paid) {
-      return;
+    switch (pi.status) {
+      case PeerPullPaymentIncomingStatus.Paid:
+        return;
+      case PeerPullPaymentIncomingStatus.Proposed:
+        return;
+      case PeerPullPaymentIncomingStatus.Accepted:
+        break;
     }
     const opId = TaskIdentifiers.forPeerPullPaymentDebit(pi);
     const retryRecord = await tx.operationRetries.get(opId);
diff --git a/packages/taler-wallet-core/src/wallet.ts 
b/packages/taler-wallet-core/src/wallet.ts
index 47724efdc..8614fd7e3 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -199,7 +199,7 @@ import {
 import {
   acceptIncomingPeerPullPayment,
   confirmPeerPushPayment,
-  preparePeerPullCredit,
+  preparePeerPullDebit,
   preparePeerPushCredit,
   initiatePeerPullPayment,
   initiatePeerPushPayment,
@@ -1462,7 +1462,7 @@ async function dispatchRequestInternal<Op extends 
WalletApiOperation>(
     }
     case WalletApiOperation.PreparePeerPullDebit: {
       const req = codecForCheckPeerPullPaymentRequest().decode(payload);
-      return await preparePeerPullCredit(ws, req);
+      return await preparePeerPullDebit(ws, req);
     }
     case WalletApiOperation.ConfirmPeerPullDebit: {
       const req = codecForAcceptPeerPullPaymentRequest().decode(payload);

-- 
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]