You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
don't block on setting up room crypto
this will load members in case of LL and could take quite some time The two async actions performed by onCryptoEvent is saving the crypto config to the roomlist store and fetching the room members to track. Both are guarded against double calls so not awaiting this should be fine.
This commit is contained in:
@@ -1085,15 +1085,16 @@ SyncApi.prototype._processSyncResponse = async function(
|
||||
|
||||
self._processEventsForNotifs(room, timelineEvents);
|
||||
|
||||
async function processRoomEvent(e) {
|
||||
function processRoomEvent(e) {
|
||||
client.emit("event", e);
|
||||
if (e.isState() && e.getType() == "m.room.encryption" && self.opts.crypto) {
|
||||
await self.opts.crypto.onCryptoEvent(e);
|
||||
self.opts.crypto.onCryptoEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.mapSeries(stateEvents, processRoomEvent);
|
||||
await Promise.mapSeries(timelineEvents, processRoomEvent);
|
||||
stateEvents.forEach(processRoomEvent);
|
||||
timelineEvents.forEach(processRoomEvent);
|
||||
|
||||
ephemeralEvents.forEach(function(e) {
|
||||
client.emit("event", e);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user