Skip to content

Commit

Permalink
fix import desaster
Browse files Browse the repository at this point in the history
Signed-off-by: Timo K <[email protected]>
  • Loading branch information
toger5 committed Feb 14, 2024
1 parent c7f9665 commit 1fd5b89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/matrixrtc/MatrixRTCSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import { Room } from "../models/room";
import { MatrixClient } from "../client";
import { EventType } from "../@types/event";
import { CallMembership, CallMembershipData } from "./CallMembership";
import { RoomStateEvent } from "../models/room-state";
import { Focus } from "./focus";
import { MatrixError, MatrixEvent, RoomStateEvent } from "../matrix";
import { MatrixError, MatrixEvent } from "../matrix";
import { randomString, secureRandomBase64Url } from "../randomstring";
import { EncryptionKeysEventContent } from "./types";
import { decodeBase64, encodeUnpaddedBase64 } from "../base64";
Expand Down Expand Up @@ -193,7 +194,8 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M
) {
super();
this._callId = memberships[0]?.callId;
this.room.on(RoomStateEvent.Members, this.onMembershipUpdate);
const roomState = this.room.getLiveTimeline().getState(EventTimeline.FORWARDS);
roomState?.on(RoomStateEvent.Members, this.onMembershipUpdate);

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › Creates a room-scoped session from room state

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:55:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › ignores expired memberships events

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:72:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › ignores memberships events of members not in the room

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:80:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › honours created_ts

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:89:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › returns empty session if no membership events are present

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:95:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › safely ignores events with no memberships section

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:117:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › safely ignores events with junk memberships section

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:139:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › ignores memberships with no expires_ts

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:147:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › ignores memberships with no device_id

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:155:39)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 18)

MatrixRTCSession › ignores memberships with no call_id

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:163:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › Creates a room-scoped session from room state

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:55:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › ignores expired memberships events

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:72:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › ignores memberships events of members not in the room

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:80:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › honours created_ts

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:89:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › returns empty session if no membership events are present

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:95:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › safely ignores events with no memberships section

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:117:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › safely ignores events with junk memberships section

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:139:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › ignores memberships with no expires_ts

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:147:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › ignores memberships with no device_id

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:155:39)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node lts/*)

MatrixRTCSession › ignores memberships with no call_id

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:163:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › Creates a room-scoped session from room state

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:55:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › ignores expired memberships events

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:72:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › ignores memberships events of members not in the room

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:80:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › honours created_ts

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:89:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › returns empty session if no membership events are present

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:95:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › safely ignores events with no memberships section

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:117:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › safely ignores events with junk memberships section

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:139:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › ignores memberships with no expires_ts

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:147:33)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › ignores memberships with no device_id

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:155:39)

Check failure on line 198 in src/matrixrtc/MatrixRTCSession.ts

View workflow job for this annotation

GitHub Actions / Jest [unit] (Node 21)

MatrixRTCSession › ignores memberships with no call_id

TypeError: roomState.on is not a function at new on (src/matrixrtc/MatrixRTCSession.ts:198:20) at Function.roomSessionForRoom (src/matrixrtc/MatrixRTCSession.ts:187:16) at Object.roomSessionForRoom (spec/unit/matrixrtc/MatrixRTCSession.spec.ts:163:33)
this.setExpiryTimer();
}

Expand All @@ -217,7 +219,8 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M
clearTimeout(this.memberEventTimeout);
this.memberEventTimeout = undefined;
}
this.room.off(RoomStateEvent.Members, this.onMembershipUpdate);
const roomState = this.room.getLiveTimeline().getState(EventTimeline.FORWARDS);
roomState?.off(RoomStateEvent.Members, this.onMembershipUpdate);
}

/**
Expand Down

0 comments on commit 1fd5b89

Please sign in to comment.