compress new e2ee stores into one new idb version
This commit is contained in:
parent
2f835238c8
commit
0b26e6f53a
1 changed files with 4 additions and 30 deletions
|
@ -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});
|
||||
}
|
||||
|
|
Reference in a new issue