forked from mystiq/hydrogen-web
await txns
This commit is contained in:
parent
71ba2dd714
commit
a943467e71
1 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ export class Encryption {
|
|||
}
|
||||
|
||||
async _findExistingSessions(devices) {
|
||||
const txn = this._storage.readTxn([this._storage.storeNames.olmSessions]);
|
||||
const txn = await this._storage.readTxn([this._storage.storeNames.olmSessions]);
|
||||
const sessionIdsForDevice = await Promise.all(devices.map(async device => {
|
||||
return await txn.olmSessions.getSessionIds(device.curve25519Key);
|
||||
}));
|
||||
|
@ -195,7 +195,7 @@ export class Encryption {
|
|||
}
|
||||
|
||||
async _loadSessions(encryptionTargets) {
|
||||
const txn = this._storage.readTxn([this._storage.storeNames.olmSessions]);
|
||||
const txn = await this._storage.readTxn([this._storage.storeNames.olmSessions]);
|
||||
// given we run loading in parallel, there might still be some
|
||||
// storage requests that will finish later once one has failed.
|
||||
// those should not allocate a session anymore.
|
||||
|
@ -221,7 +221,7 @@ export class Encryption {
|
|||
}
|
||||
|
||||
async _storeSessions(encryptionTargets, timestamp) {
|
||||
const txn = this._storage.readWriteTxn([this._storage.storeNames.olmSessions]);
|
||||
const txn = await this._storage.readWriteTxn([this._storage.storeNames.olmSessions]);
|
||||
try {
|
||||
for (const target of encryptionTargets) {
|
||||
const sessionEntry = createSessionEntry(
|
||||
|
|
Loading…
Reference in a new issue