try sending out pending room keys after first sync

This commit is contained in:
Bruno Windels 2020-09-08 14:39:07 +02:00
parent 31d4b6f75d
commit 1aa044667c
2 changed files with 11 additions and 2 deletions

View file

@ -217,7 +217,7 @@ export class Session {
this._sendScheduler.start(); this._sendScheduler.start();
for (const [, room] of this._rooms) { for (const [, room] of this._rooms) {
room.resumeSending(); room.start();
} }
} }

View file

@ -217,7 +217,16 @@ export class Room extends EventEmitter {
} }
/** @package */ /** @package */
resumeSending() { async start() {
if (this._roomEncryption) {
try {
// if we got interrupted last time sending keys to newly joined members
await this._roomEncryption.shareRoomKeyToPendingMembers(this._hsApi);
} catch (err) {
// we should not throw here
console.error(`could not send out pending room keys for room ${this.id}`, err.stack);
}
}
this._sendQueue.resumeSending(); this._sendQueue.resumeSending();
} }