gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-wallet-webex] 03/10: only invoke afterCommitCallback


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] 03/10: only invoke afterCommitCallback for transactions that change data
Date: Sat, 17 Aug 2019 01:54:36 +0200

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

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

commit 262885679cd8bedaa7b99aab5432daf7bf514a05
Author: Florian Dold <address@hidden>
AuthorDate: Fri Aug 16 22:35:44 2019 +0200

    only invoke afterCommitCallback for transactions that change data
---
 packages/idb-bridge/src/MemoryBackend.ts | 5 +++--
 packages/idb-bridge/tsconfig.json        | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/packages/idb-bridge/src/MemoryBackend.ts 
b/packages/idb-bridge/src/MemoryBackend.ts
index e09a2898..4154435a 100644
--- a/packages/idb-bridge/src/MemoryBackend.ts
+++ b/packages/idb-bridge/src/MemoryBackend.ts
@@ -1416,7 +1416,8 @@ export class MemoryBackend implements Backend {
     if (!db) {
       throw Error("db not found");
     }
-    if (db.txLevel < TransactionLevel.Read) {
+    const txLevel = db.txLevel;
+    if (txLevel < TransactionLevel.Read) {
       throw Error("only allowed while running a transaction");
     }
 
@@ -1455,7 +1456,7 @@ export class MemoryBackend implements Backend {
     delete this.connectionsByTransaction[btx.transactionCookie];
     this.transactionDoneCond.trigger();
 
-    if (this.afterCommitCallback) {
+    if (this.afterCommitCallback && txLevel >= TransactionLevel.Write) {
       await this.afterCommitCallback();
     }
   }
diff --git a/packages/idb-bridge/tsconfig.json 
b/packages/idb-bridge/tsconfig.json
index d3a746e1..017afdae 100644
--- a/packages/idb-bridge/tsconfig.json
+++ b/packages/idb-bridge/tsconfig.json
@@ -9,7 +9,8 @@
         "noEmitOnError": true,
         "strict": true,
         "incremental": true,
-        "sourceMap": true
+        "sourceMap": true,
+        "types": []
     },
     "include": ["src/**/*"]
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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