mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
fix getChild before rageshake setup
This commit is contained in:
@@ -15,9 +15,9 @@ import { scan } from "rxjs";
|
|||||||
import { type WidgetHelpers } from "../src/widget";
|
import { type WidgetHelpers } from "../src/widget";
|
||||||
import { type LivekitRoomItem } from "../src/state/CallViewModel/CallViewModel";
|
import { type LivekitRoomItem } from "../src/state/CallViewModel/CallViewModel";
|
||||||
|
|
||||||
export const logger = rootLogger.getChild("[MatrixRTCSdk]");
|
|
||||||
|
|
||||||
export const tryMakeSticky = (widget: WidgetHelpers): void => {
|
export const tryMakeSticky = (widget: WidgetHelpers): void => {
|
||||||
|
const logger = rootLogger.getChild("[MatrixRTCSdk]");
|
||||||
logger.info("try making sticky MatrixRTCSdk");
|
logger.info("try making sticky MatrixRTCSdk");
|
||||||
void widget.api
|
void widget.api
|
||||||
.setAlwaysOnScreen(true)
|
.setAlwaysOnScreen(true)
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ import { getUrlParams } from "../src/UrlParams";
|
|||||||
import { MuteStates } from "../src/state/MuteStates";
|
import { MuteStates } from "../src/state/MuteStates";
|
||||||
import { MediaDevices } from "../src/state/MediaDevices";
|
import { MediaDevices } from "../src/state/MediaDevices";
|
||||||
import { E2eeType } from "../src/e2ee/e2eeType";
|
import { E2eeType } from "../src/e2ee/e2eeType";
|
||||||
import { currentAndPrev, logger, TEXT_LK_TOPIC, tryMakeSticky } from "./helper";
|
import { currentAndPrev, TEXT_LK_TOPIC, tryMakeSticky } from "./helper";
|
||||||
|
import {logger as rootLogger} from "matrix-js-sdk/lib/logger"
|
||||||
import {
|
import {
|
||||||
ElementWidgetActions,
|
ElementWidgetActions,
|
||||||
widget as _widget,
|
widget as _widget,
|
||||||
@@ -104,6 +105,7 @@ export async function createMatrixRTCSdk(
|
|||||||
id: string = "",
|
id: string = "",
|
||||||
sticky: boolean = false,
|
sticky: boolean = false,
|
||||||
): Promise<MatrixRTCSdk> {
|
): Promise<MatrixRTCSdk> {
|
||||||
|
const logger = rootLogger.getChild("[MatrixRTCSdk]");
|
||||||
const scope = new ObservableScope();
|
const scope = new ObservableScope();
|
||||||
|
|
||||||
// widget client
|
// widget client
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ import {
|
|||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
MatrixRTCSessionEvent,
|
MatrixRTCSessionEvent,
|
||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
} from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import { logger as rootLogger } from "matrix-js-sdk/lib/logger";
|
import { logger as rootLogger, type Logger } from "matrix-js-sdk/lib/logger";
|
||||||
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
||||||
const logger = rootLogger.getChild("[MatrixKeyProvider]");
|
|
||||||
|
|
||||||
export class MatrixKeyProvider extends BaseKeyProvider {
|
export class MatrixKeyProvider extends BaseKeyProvider {
|
||||||
private rtcSession?: MatrixRTCSession;
|
private rtcSession?: MatrixRTCSession;
|
||||||
|
private logger: Logger;
|
||||||
public constructor() {
|
public constructor() {
|
||||||
super({ ratchetWindowSize: 10, keyringSize: 256 });
|
super({ ratchetWindowSize: 10, keyringSize: 256 });
|
||||||
|
this.logger = rootLogger.getChild("[MatrixKeyProvider]");
|
||||||
}
|
}
|
||||||
|
|
||||||
public setRTCSession(rtcSession: MatrixRTCSession): void {
|
public setRTCSession(rtcSession: MatrixRTCSession): void {
|
||||||
@@ -60,12 +60,12 @@ export class MatrixKeyProvider extends BaseKeyProvider {
|
|||||||
encryptionKeyIndex,
|
encryptionKeyIndex,
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.debug(
|
this.logger.debug(
|
||||||
`Sent new key to livekit room=${this.rtcSession?.room.roomId} participantId=${rtcBackendIdentity} (before hash: ${membershipParts.userId}:${membershipParts.deviceId}) encryptionKeyIndex=${encryptionKeyIndex}`,
|
`Sent new key to livekit room=${this.rtcSession?.room.roomId} participantId=${rtcBackendIdentity} (before hash: ${membershipParts.userId}:${membershipParts.deviceId}) encryptionKeyIndex=${encryptionKeyIndex}`,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
(e) => {
|
(e) => {
|
||||||
logger.error(
|
this.logger.error(
|
||||||
`Failed to create key material from buffer for livekit room=${this.rtcSession?.room.roomId} participantId before hash=${membershipParts.userId}:${membershipParts.deviceId} encryptionKeyIndex=${encryptionKeyIndex}`,
|
`Failed to create key material from buffer for livekit room=${this.rtcSession?.room.roomId} participantId before hash=${membershipParts.userId}:${membershipParts.deviceId} encryptionKeyIndex=${encryptionKeyIndex}`,
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ export interface MatrixAudioRendererProps {
|
|||||||
muted?: boolean;
|
muted?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const prefixedLogger = logger.getChild("[MatrixAudioRenderer]");
|
|
||||||
/**
|
/**
|
||||||
* Takes care of handling remote participants’ audio tracks and makes sure that microphones and screen share are audible.
|
* Takes care of handling remote participants’ audio tracks and makes sure that microphones and screen share are audible.
|
||||||
*
|
*
|
||||||
@@ -60,6 +59,7 @@ export function LivekitRoomAudioRenderer({
|
|||||||
validIdentities,
|
validIdentities,
|
||||||
muted,
|
muted,
|
||||||
}: MatrixAudioRendererProps): ReactNode {
|
}: MatrixAudioRendererProps): ReactNode {
|
||||||
|
const prefixedLogger = logger.getChild("[MatrixAudioRenderer]");
|
||||||
const tracks = useTracks(
|
const tracks = useTracks(
|
||||||
[
|
[
|
||||||
Track.Source.Microphone,
|
Track.Source.Microphone,
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ declare global {
|
|||||||
// eslint-disable-next-line no-var, camelcase
|
// eslint-disable-next-line no-var, camelcase
|
||||||
var mx_rage_initStoragePromise: Promise<void> | undefined;
|
var mx_rage_initStoragePromise: Promise<void> | undefined;
|
||||||
}
|
}
|
||||||
|
export let rageshakeLogger: Logger;
|
||||||
/**
|
/**
|
||||||
* Configure rage shaking support for sending bug reports.
|
* Configure rage shaking support for sending bug reports.
|
||||||
* Modifies globals.
|
* Modifies globals.
|
||||||
@@ -477,7 +477,8 @@ export async function init(): Promise<void> {
|
|||||||
global.mx_rage_logger = new ConsoleLogger();
|
global.mx_rage_logger = new ConsoleLogger();
|
||||||
|
|
||||||
// configure loglevel based loggers:
|
// configure loglevel based loggers:
|
||||||
setLogExtension(logger, global.mx_rage_logger.log);
|
rageshakeLogger = logger;
|
||||||
|
setLogExtension(rageshakeLogger, global.mx_rage_logger.log);
|
||||||
|
|
||||||
// intercept console logging so that we can get matrix_sdk logs:
|
// intercept console logging so that we can get matrix_sdk logs:
|
||||||
// this is nasty, but no logging hooks are provided
|
// this is nasty, but no logging hooks are provided
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ import {
|
|||||||
} from "../media/RingingMediaViewModel.ts";
|
} from "../media/RingingMediaViewModel.ts";
|
||||||
import { type GridTileViewModel } from "../TileViewModel.ts";
|
import { type GridTileViewModel } from "../TileViewModel.ts";
|
||||||
|
|
||||||
const logger = rootLogger.getChild("[CallViewModel]");
|
|
||||||
//TODO
|
//TODO
|
||||||
// Larger rename
|
// Larger rename
|
||||||
// member,membership -> rtcMember
|
// member,membership -> rtcMember
|
||||||
@@ -411,6 +411,7 @@ export function createCallViewModel$(
|
|||||||
reactionsSubject$: Observable<Record<string, ReactionInfo>>,
|
reactionsSubject$: Observable<Record<string, ReactionInfo>>,
|
||||||
trackProcessorState$: Behavior<ProcessorState>,
|
trackProcessorState$: Behavior<ProcessorState>,
|
||||||
): CallViewModel {
|
): CallViewModel {
|
||||||
|
const logger = rootLogger.getChild("[CallViewModel]");
|
||||||
const client = matrixRoom.client;
|
const client = matrixRoom.client;
|
||||||
const userId = client.getUserId();
|
const userId = client.getUserId();
|
||||||
const deviceId = client.getDeviceId();
|
const deviceId = client.getDeviceId();
|
||||||
|
|||||||
Reference in New Issue
Block a user