1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Always migrate inbound group sessions

This commit is contained in:
David Baker
2018-01-02 13:31:57 +00:00
parent e5086f22d6
commit c43ccb860b

View File

@@ -223,14 +223,8 @@ OlmDevice.prototype._migrateFromSessionStore = async function() {
let numIbSessions = 0; let numIbSessions = 0;
await this._cryptoStore.doTxn( await this._cryptoStore.doTxn(
'readwrite', [IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS], (txn) => { 'readwrite', [IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS], (txn) => {
this._cryptoStore.countEndToEndInboundGroupSessions(txn, (count) => { // We always migrate inbound group sessions, even if we already have some
if (count) { // in the new store. They should be be safe to migrate.
console.log(
"Cryto store already has inbound group sessions: "+
"not migrating",
);
return;
}
for (const s of ibGroupSessions) { for (const s of ibGroupSessions) {
try { try {
this._cryptoStore.addEndToEndInboundGroupSession( this._cryptoStore.addEndToEndInboundGroupSession(
@@ -253,7 +247,6 @@ OlmDevice.prototype._migrateFromSessionStore = async function() {
"Migrating " + numIbSessions + "Migrating " + numIbSessions +
" inbound group sessions from session store", " inbound group sessions from session store",
); );
});
}, },
); );
this._sessionStore.removeAllEndToEndInboundGroupSessions(); this._sessionStore.removeAllEndToEndInboundGroupSessions();