diff --git a/src/matrix/room/BaseRoom.js b/src/matrix/room/BaseRoom.js index 6f14b7f9..851e75c9 100644 --- a/src/matrix/room/BaseRoom.js +++ b/src/matrix/room/BaseRoom.js @@ -166,6 +166,16 @@ export class BaseRoom extends EventEmitter { if (this._observedEvents) { this._observedEvents.updateEvents(entries); } + if (isTimelineOpen && decryption.hasUnverifiedSenders) { + // verify missing senders async and update timeline once done so we don't delay rendering with network requests + log.wrapDetached("fetch unknown senders keys", async () => { + const newlyVerifiedDecryption = await decryption.fetchAndVerifyRemainingSenders(this._hsApi, log); + const verifiedEntries = []; + newlyVerifiedDecryption.applyToEntries(entries, entry => verifiedEntries.push(entry)); + this._timeline?.replaceEntries(verifiedEntries); + this._observedEvents?.updateEvents(verifiedEntries); + }); + } }, ensureLogItem(log)); return request; }