From 0b26e6f53ac1765df54db638075759274fd1cc94 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 11 Sep 2020 08:40:43 +0200 Subject: [PATCH] compress new e2ee stores into one new idb version --- src/matrix/storage/idb/schema.js | 34 ++++---------------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/matrix/storage/idb/schema.js b/src/matrix/storage/idb/schema.js index f1817c24..1ed9cadb 100644 --- a/src/matrix/storage/idb/schema.js +++ b/src/matrix/storage/idb/schema.js @@ -9,12 +9,7 @@ export const schema = [ createInitialStores, createMemberStore, migrateSession, - createIdentityStores, - createOlmSessionStore, - createInboundGroupSessionsStore, - createOutboundGroupSessionsStore, - createGroupSessionDecryptions, - addSenderKeyIndexToDeviceStore + createE2EEStores ]; // TODO: how to deal with git merge conflicts of this array? @@ -71,33 +66,12 @@ async function migrateSession(db, txn) { } } //v4 -function createIdentityStores(db) { +function createE2EEStores(db) { db.createObjectStore("userIdentities", {keyPath: "userId"}); - db.createObjectStore("deviceIdentities", {keyPath: "key"}); -} - -//v5 -function createOlmSessionStore(db) { + const deviceIdentities = db.createObjectStore("deviceIdentities", {keyPath: "key"}); + deviceIdentities.createIndex("byCurve25519Key", "curve25519Key", {unique: true}); db.createObjectStore("olmSessions", {keyPath: "key"}); -} - -//v6 -function createInboundGroupSessionsStore(db) { db.createObjectStore("inboundGroupSessions", {keyPath: "key"}); -} - -//v7 -function createOutboundGroupSessionsStore(db) { db.createObjectStore("outboundGroupSessions", {keyPath: "roomId"}); -} - -//v8 -function createGroupSessionDecryptions(db) { db.createObjectStore("groupSessionDecryptions", {keyPath: "key"}); } - -//v9 -function addSenderKeyIndexToDeviceStore(db, txn) { - const deviceIdentities = txn.objectStore("deviceIdentities"); - deviceIdentities.createIndex("byCurve25519Key", "curve25519Key", {unique: true}); -}