Skip to content

Commit

Permalink
Force decrypt the events before we start processing the rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale Fukami committed Oct 17, 2023
1 parent d61983e commit 9f716d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/chat/matrix-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const stubRoom = (attrs = {}) => ({
getMembers: () => [],
getDMInviter: () => undefined,
loadMembersIfNeeded: () => undefined,
decryptAllEvents: () => undefined,
getLiveTimeline: () => stubTimeline(),
getMyMembership: () => 'join',
getEvents: () => stubTimeline(),
Expand Down
2 changes: 2 additions & 0 deletions src/lib/chat/matrix-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class MatrixClient implements IChatClient {
await this.waitForConnection();
const rooms = await this.getFilteredRooms(this.isChannel);
for (const room of rooms) {
await room.decryptAllEvents();
await room.loadMembersIfNeeded();
}

Expand All @@ -108,6 +109,7 @@ export class MatrixClient implements IChatClient {

const failedToJoin = [];
for (const room of rooms) {
await room.decryptAllEvents();
await room.loadMembersIfNeeded();
const membership = room.getMyMembership();
if (membership === MembershipStateType.Invite) {
Expand Down

0 comments on commit 9f716d1

Please sign in to comment.