From e9b8cfbd9e328437f2484d0a384a4a76b6e2493f Mon Sep 17 00:00:00 2001 From: Robert Long Date: Tue, 18 Oct 2022 12:56:58 -0700 Subject: [PATCH 1/3] Member should be expired if there's no expires at key --- src/matrix/calls/group/Member.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/calls/group/Member.ts b/src/matrix/calls/group/Member.ts index 8763bf5e..0aba3b54 100644 --- a/src/matrix/calls/group/Member.ts +++ b/src/matrix/calls/group/Member.ts @@ -416,5 +416,5 @@ export function memberExpiresAt(callDeviceMembership: CallDeviceMembership): num export function isMemberExpired(callDeviceMembership: CallDeviceMembership, now: number, margin: number = 0) { const expiresAt = memberExpiresAt(callDeviceMembership); - return typeof expiresAt === "number" && ((expiresAt + margin) <= now); + return typeof expiresAt === "number" ? ((expiresAt + margin) <= now) : true; } From c0306b45a606023793aaa869a175e7661bad2824 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Tue, 18 Oct 2022 13:43:19 -0700 Subject: [PATCH 2/3] Fix typechecking --- src/logging/NullLogger.ts | 4 +++- src/platform/web/ui/session/room/CallView.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/logging/NullLogger.ts b/src/logging/NullLogger.ts index f6f877b3..bf7b3f40 100644 --- a/src/logging/NullLogger.ts +++ b/src/logging/NullLogger.ts @@ -21,7 +21,9 @@ function noop (): void {} export class NullLogger implements ILogger { public readonly item: ILogItem = new NullLogItem(this); - log(): void {} + log(): ILogItem { + return this.item; + } addReporter() {} diff --git a/src/platform/web/ui/session/room/CallView.ts b/src/platform/web/ui/session/room/CallView.ts index 6961dc53..619afc2e 100644 --- a/src/platform/web/ui/session/room/CallView.ts +++ b/src/platform/web/ui/session/room/CallView.ts @@ -80,7 +80,7 @@ export class CallView extends TemplateView { public unmount() { if (this.resizeObserver) { - this.resizeObserver.unobserve((this.root()! as Element).querySelector(".CallView_members")); + this.resizeObserver.unobserve((this.root()! as Element).querySelector(".CallView_members")!); this.resizeObserver = undefined; } super.unmount(); From 32835e26b9b2435dc7db32d76a82cf698ee11216 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Thu, 10 Nov 2022 14:08:34 +0100 Subject: [PATCH 3/3] adjust query for finding all state events of a type we were looking for state events with state key between \0 and \u10FFFF but an empty state key is also valid and would come before \0, so allow empty state keys at the beginning of the range and include them in the result by opening the lower bound. --- src/matrix/storage/idb/stores/RoomStateStore.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/storage/idb/stores/RoomStateStore.ts b/src/matrix/storage/idb/stores/RoomStateStore.ts index 99315e9e..e7661378 100644 --- a/src/matrix/storage/idb/stores/RoomStateStore.ts +++ b/src/matrix/storage/idb/stores/RoomStateStore.ts @@ -43,9 +43,9 @@ export class RoomStateStore { getAllForType(roomId: string, type: string): Promise { const range = this._roomStateStore.IDBKeyRange.bound( - encodeKey(roomId, type, MIN_UNICODE), + encodeKey(roomId, type, ""), encodeKey(roomId, type, MAX_UNICODE), - true, + false, true ); return this._roomStateStore.selectAll(range);