gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-wallet-webex] 08/10: idb-bridge: fix bug in index de


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] 08/10: idb-bridge: fix bug in index deletion
Date: Sat, 17 Aug 2019 01:54:41 +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 9e3a26ca70e77265f74527eb183c3f80b6531a97
Author: Florian Dold <address@hidden>
AuthorDate: Sat Aug 17 01:50:51 2019 +0200

    idb-bridge: fix bug in index deletion
---
 packages/idb-bridge/src/MemoryBackend.ts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/packages/idb-bridge/src/MemoryBackend.ts 
b/packages/idb-bridge/src/MemoryBackend.ts
index a47c0a13..b5087b86 100644
--- a/packages/idb-bridge/src/MemoryBackend.ts
+++ b/packages/idb-bridge/src/MemoryBackend.ts
@@ -244,6 +244,9 @@ export class MemoryBackend implements Backend {
    * been made.
    */
   importDump(data: any) {
+    if (this.enableTracing) {
+      console.log("importing dump (a)");
+    }
     if (this.transactionIdCounter != 1 || this.connectionIdCounter != 1) {
       throw Error(
         "data must be imported before first transaction or connection",
@@ -326,6 +329,7 @@ export class MemoryBackend implements Backend {
    * Only exports data that has been committed.
    */
   exportDump(): MemoryBackendDump {
+    this.enableTracing && console.log("exporting dump");
     const dbDumps: { [name: string]: DatabaseDump } = {};
     for (const dbName of Object.keys(this.databases)) {
       const db = this.databases[dbName];
@@ -873,12 +877,12 @@ export class MemoryBackend implements Backend {
         throw Error("assertion failed");
       }
 
-
       for (const indexName of 
Object.keys(schema.objectStores[objectStoreName].indexes)) {
         const index = 
myConn.objectStoreMap[objectStoreName].indexMap[indexName];
         if (!index) {
           throw Error("index referenced by object store does not exist");
         }
+        this.enableTracing && console.log(`deleting from index ${indexName} 
for object store ${objectStoreName}`);
         const indexProperties = 
schema.objectStores[objectStoreName].indexes[indexName];
         this.deleteFromIndex(
           index,
@@ -925,7 +929,7 @@ export class MemoryBackend implements Backend {
         x => compareKeys(x, primaryKey) !== 0,
       );
       if (newPrimaryKeys.length === 0) {
-        index.originalData = indexData.without(indexKey);
+        index.modifiedData = indexData.without(indexKey);
       } else {
         const newIndexRecord = {
           indexKey,

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



reply via email to

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