gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant-backoffice] branch master updated: error handling upon w


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: error handling upon withdrawal
Date: Fri, 29 Apr 2022 16:39:10 +0200

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

ms pushed a commit to branch master
in repository merchant-backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new 2672d10  error handling upon withdrawal
2672d10 is described below

commit 2672d10e87d502c5dc05acf778f4ffcc73bb0973
Author: ms <ms@taler.net>
AuthorDate: Fri Apr 29 16:38:55 2022 +0200

    error handling upon withdrawal
---
 packages/bank/src/pages/home/index.tsx | 44 +++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/packages/bank/src/pages/home/index.tsx 
b/packages/bank/src/pages/home/index.tsx
index 39c165b..89ab74a 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -1011,6 +1011,12 @@ function TalerWithdrawalQRCode(Props: any): VNode {
     accountLabel,
     backendState } = Props;
   const i18n = useTranslator();
+  const abortButton = <a class="pure-button" onClick={() => {
+        pageStateSetter((prevState: PageStateType) => {
+          const { withdrawalOutcome, withdrawalId, talerWithdrawUri, ...rest } 
= prevState;
+          return { ...rest, withdrawalInProgress: false };
+  })}}>{i18n`Abort`}</a>
+
   console.log(`Showing withdraw URI: ${talerWithdrawUri}`);
   // waiting for the wallet:
 
@@ -1018,8 +1024,12 @@ function TalerWithdrawalQRCode(Props: any): VNode {
   if (typeof error !== "undefined") {
     console.log(`withdrawal (${withdrawalId}) was never (correctly) created at 
the bank...`, error);
     pageStateSetter((prevState: PageStateType) => ({
-      ...prevState, hasError: true, error: error
-  }))}
+      ...prevState,
+      hasError: true,
+      error: i18n`withdrawal (${withdrawalId}) was never (correctly) created 
at the bank...`
+    }))
+    return (<Fragment><br /><br />{abortButton}</Fragment>);
+  }
 
   // data didn't arrive yet and wallet didn't communicate:
   if (typeof data === "undefined") {
@@ -1053,11 +1063,7 @@ function TalerWithdrawalQRCode(Props: any): VNode {
       {QR({text: talerWithdrawUri})}
       <p>Click <a href={talerWithdrawUri}>{i18n`this link`}</a> to open your 
Taler wallet!</p>
       <br />
-      <a class="pure-button" onClick={() => {
-        pageStateSetter((prevState: PageStateType) => {
-          const { withdrawalOutcome, withdrawalId, talerWithdrawUri, ...rest } 
= prevState;
-          return { ...rest, withdrawalInProgress: false };
-      })}}>{i18n`Abort`}</a>
+      {abortButton}
       </section>);
   }
   /**
@@ -1204,7 +1210,7 @@ function RegistrationForm(Props: any): VNode {
                     username: e.currentTarget.value,
                   }))}} />
               <input
-                type="text"
+                type="password"
                 placeholder="password"
                 required
                 autofocus
@@ -1345,16 +1351,20 @@ function Account(Props: any): VNode {
 
        /**
         * 404 should never stick to the cache, because they
-        * taint successful registrations:
+        * taint successful future registrations.  How?  After
+        * registering, the user gets navigated to this page,
+        * therefore a previous 404 on this SWR key (the requested
+        * resource) would still appear as valid and cause this
+        * page not to be shown! A typical case is an attempted
+        * login of a unregistered user X, and then a registration
+        * attempt of the same user X: in this case, the failed
+        * login would cache a 404 error to X's profile, resulting
+        * in the legitimate request after the registration to still
+        * be flagged as 404.  Clearing the cache should prevent
+        * this and likely not pose additional problems (given that
+        * the user couldn't have been logged before).
         */
-       console.log("Cache at Account:", cache);
-       for (const key of Object.keys(cache)) {
-          console.log("processing key: " + key);
-          if (RegExp(`${endpoint}$`).test(key)) {
-           console.log("Deleting key: " + key);
-            cache.delete(key)
-         }
-       }
+        (cache as any).clear();
         return <p>Profile not found...</p>;
       }
       case 401: {

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