diff options
author | Florian Dold <florian@dold.me> | 2022-01-11 21:00:12 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-01-11 22:15:56 +0100 |
commit | a74cdf05295764258fe9e7f66f73a442a9b46697 (patch) | |
tree | d1a662fede130abc1fa33cdbc96c081cc47b23cd /packages/idb-bridge/src/bridge-idb.ts | |
parent | a05e891d6e1468fdd99f710301e286857a46aea3 (diff) | |
download | wallet-core-a74cdf05295764258fe9e7f66f73a442a9b46697.tar.xz |
fix DB indexing issues
Diffstat (limited to 'packages/idb-bridge/src/bridge-idb.ts')
-rw-r--r-- | packages/idb-bridge/src/bridge-idb.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/idb-bridge/src/bridge-idb.ts b/packages/idb-bridge/src/bridge-idb.ts index 5d5f531b0..8264b43ec 100644 --- a/packages/idb-bridge/src/bridge-idb.ts +++ b/packages/idb-bridge/src/bridge-idb.ts @@ -64,7 +64,10 @@ import { makeStoreKeyValue } from "./util/makeStoreKeyValue"; import { normalizeKeyPath } from "./util/normalizeKeyPath"; import { openPromise } from "./util/openPromise"; import queueTask from "./util/queueTask"; -import { structuredClone } from "./util/structuredClone"; +import { + checkStructuredCloneOrThrow, + structuredClone, +} from "./util/structuredClone"; import { validateKeyPath } from "./util/validateKeyPath"; import { valueToKey } from "./util/valueToKey"; @@ -303,7 +306,7 @@ export class BridgeIDBCursor implements IDBCursor { try { // Only called for the side effect of throwing an exception - structuredClone(value); + checkStructuredCloneOrThrow(value); } catch (e) { throw new DataCloneError(); } @@ -327,6 +330,7 @@ export class BridgeIDBCursor implements IDBCursor { } const { btx } = this.source._confirmStartedBackendTransaction(); await this._backend.storeRecord(btx, storeReq); + // FIXME: update the index position here! }; return transaction._execRequestAsync({ operation, |