[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: -only store key if necessary
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: -only store key if necessary |
Date: |
Wed, 30 Aug 2023 16:08:54 +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 53613a137 -only store key if necessary
53613a137 is described below
commit 53613a137df432878d62317e685bd1737dc6a6dc
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Aug 30 16:08:51 2023 +0200
-only store key if necessary
---
packages/taler-wallet-core/src/db.ts | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/packages/taler-wallet-core/src/db.ts
b/packages/taler-wallet-core/src/db.ts
index 2dbf5dade..ba5295dda 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -2772,8 +2772,10 @@ export const walletMetadataStore = {
export interface DbDumpRecord {
/**
* Key, serialized with structuredEncapsulated.
+ *
+ * Only present for out-of-line keys (i.e. no key path).
*/
- key: any;
+ key?: any;
/**
* Value, serialized with structuredEncapsulated.
*/
@@ -2844,10 +2846,15 @@ export function exportDb(db: IDBDatabase):
Promise<DbDump> {
store.openCursor().addEventListener("success", (e: Event) => {
const cursor = (e.target as any).result;
if (cursor) {
- storeDump.records.push({
- key: structuredEncapsulate(cursor.key),
+ const rec: DbDumpRecord = {
value: structuredEncapsulate(cursor.value),
- });
+ };
+ // Only store key if necessary, i.e. when
+ // the key is not stored as part of the object via
+ // a key path.
+ if (store.keyPath == null) {
+ rec.key = structuredEncapsulate(cursor.key);
+ }
cursor.continue();
}
});
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: -only store key if necessary,
gnunet <=