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: implement hintAp


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: implement hintApplicationResumed
Date: Tue, 03 Sep 2024 23:20:34 +0200

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 fb318bf50 wallet-core: implement hintApplicationResumed
fb318bf50 is described below

commit fb318bf5072e8c71629c7d72f2131a28489822c4
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Sep 3 23:20:31 2024 +0200

    wallet-core: implement hintApplicationResumed
---
 packages/taler-wallet-core/src/wallet-api-types.ts | 13 +++++++++++++
 packages/taler-wallet-core/src/wallet.ts           | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts 
b/packages/taler-wallet-core/src/wallet-api-types.ts
index e3112174b..8ccf36e61 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -289,6 +289,7 @@ export enum WalletApiOperation {
   TestingResetAllRetries = "testingResetAllRetries",
   StartExchangeWalletKyc = "startExchangeWalletKyc",
   TestingWaitExchangeWalletKyc = "testingWaitWalletKyc",
+  HintApplicationResumed = "hintApplicationResumed",
 }
 
 // group: Initialization
@@ -310,6 +311,17 @@ export type ShutdownOp = {
   response: EmptyObject;
 };
 
+/**
+ * Give wallet-core a kick and restart all pending tasks.
+ * Useful when the host application gets suspended and resumed,
+ * and active network requests might have stalled.
+ */
+export type HintApplicationResumedOp = {
+  op: WalletApiOperation.HintApplicationResumed;
+  request: EmptyObject;
+  response: EmptyObject;
+};
+
 /**
  * Change the configuration of wallet-core.
  *
@@ -1398,6 +1410,7 @@ export type WalletOperations = {
   [WalletApiOperation.GetBankingChoicesForPayto]: GetBankingChoicesForPaytoOp;
   [WalletApiOperation.StartExchangeWalletKyc]: StartExchangeWalletKycOp;
   [WalletApiOperation.TestingWaitExchangeWalletKyc]: 
TestingWaitExchangeWalletKycOp;
+  [WalletApiOperation.HintApplicationResumed]: HintApplicationResumedOp;
 };
 
 export type WalletCoreRequestType<
diff --git a/packages/taler-wallet-core/src/wallet.ts 
b/packages/taler-wallet-core/src/wallet.ts
index a377d0795..6e3705708 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -1530,6 +1530,15 @@ async function handleGetCurrencySpecification(
   return defaultResp;
 }
 
+export async function handleHintApplicationResumed(
+  wex: WalletExecutionContext,
+  req: EmptyObject,
+): Promise<EmptyObject> {
+  logger.info("handling hintApplicationResumed");
+  await restartAllRunningTasks(wex);
+  return {};
+}
+
 async function handleGetVersion(
   wex: WalletExecutionContext,
 ): Promise<WalletCoreVersion> {
@@ -1562,6 +1571,10 @@ const handlers: { [T in WalletApiOperation]: 
HandlerWithValidator<T> } = {
     codec: codecForAny(),
     handler: handleTestingWaitExchangeState,
   },
+  [WalletApiOperation.HintApplicationResumed]: {
+    codec: codecForEmptyObject(),
+    handler: handleHintApplicationResumed,
+  },
   [WalletApiOperation.AbortTransaction]: {
     codec: codecForAbortTransaction(),
     handler: handleAbortTransaction,

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