all the other logs

This commit is contained in:
Timo K.
2026-07-07 19:12:11 +02:00
parent 3cc396f42c
commit a6921e2bfb
5 changed files with 18 additions and 15 deletions

View File

@@ -94,7 +94,7 @@ declare module "react" {
} }
} }
const logger = rootLogger.getChild("[InCallView]");
export interface ActiveCallProps extends Omit< export interface ActiveCallProps extends Omit<
InCallViewProps, InCallViewProps,
@@ -116,7 +116,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
const mediaDevices = useMediaDevices(); const mediaDevices = useMediaDevices();
const trackProcessorState$ = useTrackProcessorObservable$(); const trackProcessorState$ = useTrackProcessorObservable$();
useEffect(() => { useEffect(() => {
logger.info("START CALL VIEW SCOPE"); rootLogger.info("START CALL VIEW SCOPE");
const scope = new ObservableScope(); const scope = new ObservableScope();
const reactionsReader = new ReactionsReader(scope, props.rtcSession); const reactionsReader = new ReactionsReader(scope, props.rtcSession);
const { autoLeaveWhenOthersLeft, waitForCallPickup, sendNotificationType } = const { autoLeaveWhenOthersLeft, waitForCallPickup, sendNotificationType } =
@@ -218,6 +218,7 @@ export const InCallView: FC<InCallViewProps> = ({
muteStates, muteStates,
onShareClick, onShareClick,
}) => { }) => {
const logger = rootLogger.getChild("[InCallView]");
const { t } = useTranslation(); const { t } = useTranslation();
const { sendReaction, toggleRaisedHand } = useReactionsSender(); const { sendReaction, toggleRaisedHand } = useReactionsSender();

View File

@@ -39,8 +39,6 @@ import { type Behavior } from "../Behavior";
import { type Epoch, type ObservableScope } from "../ObservableScope"; import { type Epoch, type ObservableScope } from "../ObservableScope";
import { type RoomMemberMap } from "./remoteMembers/MatrixMemberMetadata"; import { type RoomMemberMap } from "./remoteMembers/MatrixMemberMetadata";
const logger = rootLogger.getChild("[CallNotificationLifecycle]");
export type AutoLeaveReason = "allOthersLeft" | "timeout" | "decline"; export type AutoLeaveReason = "allOthersLeft" | "timeout" | "decline";
export interface RingAttempt { export interface RingAttempt {
@@ -114,6 +112,7 @@ export function createCallNotificationLifecycle$({
*/ */
autoLeave$: Observable<AutoLeaveReason>; autoLeave$: Observable<AutoLeaveReason>;
} { } {
const logger = rootLogger.getChild("[CallNotificationLifecycle]");
let ringAttempts$: Observable<RingAttempt> = NEVER; let ringAttempts$: Observable<RingAttempt> = NEVER;
if (options.waitForCallPickup) if (options.waitForCallPickup)
ringAttempts$ = sentCallNotification$.pipe( ringAttempts$ = sentCallNotification$.pipe(

View File

@@ -31,11 +31,6 @@ import { type ObservableScope } from "../../ObservableScope";
import { type Behavior } from "../../Behavior"; import { type Behavior } from "../../Behavior";
import { type NodeStyleEventEmitter } from "../../../utils/test"; import { type NodeStyleEventEmitter } from "../../../utils/test";
/**
* Logger instance (scoped child) for homeserver connection updates.
*/
const logger = rootLogger.getChild("[HomeserverConnected]");
export type HomeserverDisconnectReason = "sync" | "membership" | "probablyLeft"; export type HomeserverDisconnectReason = "sync" | "membership" | "probablyLeft";
export interface HomeserverConnected { export interface HomeserverConnected {
@@ -70,6 +65,7 @@ export function createHomeserverConnected$(
Pick<MatrixRTCSession, "membershipStatus" | "probablyLeft">, Pick<MatrixRTCSession, "membershipStatus" | "probablyLeft">,
gracePeriodMs?: number, gracePeriodMs?: number,
): HomeserverConnected { ): HomeserverConnected {
const logger = rootLogger.getChild("[HomeserverConnected]");
// Get grace period from parameter or config (default 10000ms) // Get grace period from parameter or config (default 10000ms)
const graceMs = gracePeriodMs ?? Config.get().sync_disconnect_grace_period_ms; const graceMs = gracePeriodMs ?? Config.get().sync_disconnect_grace_period_ms;

View File

@@ -25,7 +25,7 @@ import {
switchMap, switchMap,
tap, tap,
} from "rxjs"; } from "rxjs";
import { logger as rootLogger } from "matrix-js-sdk/lib/logger"; import { logger as rootLogger, type Logger } from "matrix-js-sdk/lib/logger";
import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery"; import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery";
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager"; import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
@@ -46,8 +46,6 @@ import { areLivekitTransportsEqual } from "../remoteMembers/MatrixLivekitMembers
import { customLivekitUrl } from "../../../settings/settings.ts"; import { customLivekitUrl } from "../../../settings/settings.ts";
import { RtcTransportAutoDiscovery } from "./RtcTransportAutoDiscovery.ts"; import { RtcTransportAutoDiscovery } from "./RtcTransportAutoDiscovery.ts";
const logger = rootLogger.getChild("[LocalTransport]");
/* /*
* It figures out “which LiveKit focus URL/alias the local user should use,” * It figures out “which LiveKit focus URL/alias the local user should use,”
* optionally aligning with the oldest member, and ensures the SFU path is primed * optionally aligning with the oldest member, and ensures the SFU path is primed
@@ -140,9 +138,14 @@ export const createLocalTransport$ = ({
forceJwtEndpoint, forceJwtEndpoint,
delayId$, delayId$,
}: Props): LocalTransport => { }: Props): LocalTransport => {
const logger = rootLogger.getChild("[LocalTransport]");
// The LiveKit transport in use by the oldest RTC membership. `null` when the // The LiveKit transport in use by the oldest RTC membership. `null` when the
// oldest member has no such transport. // oldest member has no such transport.
const oldestMemberTransport$ = observerOldestMembership$(scope, memberships$); const oldestMemberTransport$ = observerOldestMembership$(
scope,
memberships$,
logger,
);
const transportDiscovery = new RtcTransportAutoDiscovery({ const transportDiscovery = new RtcTransportAutoDiscovery({
client: client, client: client,
@@ -209,6 +212,7 @@ export const createLocalTransport$ = ({
client, client,
ownMembershipIdentity, ownMembershipIdentity,
roomId, roomId,
logger,
); );
} }
@@ -248,6 +252,7 @@ export const createLocalTransport$ = ({
function observerOldestMembership$( function observerOldestMembership$(
scope: ObservableScope, scope: ObservableScope,
memberships$: Behavior<Epoch<CallMembership[]>>, memberships$: Behavior<Epoch<CallMembership[]>>,
logger: Logger,
): Behavior<LivekitTransportConfig | null> { ): Behavior<LivekitTransportConfig | null> {
return scope.behavior<LivekitTransportConfig | null>( return scope.behavior<LivekitTransportConfig | null>(
memberships$.pipe( memberships$.pipe(
@@ -307,6 +312,7 @@ async function doOpenIdAndJWTFromUrl(
> & > &
OpenIDClientParts, OpenIDClientParts,
delayId?: string, delayId?: string,
logger: Logger,
): Promise<LocalTransportWithSFUConfig> { ): Promise<LocalTransportWithSFUConfig> {
const sfuConfig = await getSFUConfigWithOpenID( const sfuConfig = await getSFUConfigWithOpenID(
client, client,
@@ -337,6 +343,7 @@ function observeLocalTransportForOldestMembership(
OpenIDClientParts, OpenIDClientParts,
ownMembershipIdentity: CallMembershipIdentityParts, ownMembershipIdentity: CallMembershipIdentityParts,
roomId: string, roomId: string,
logger: Logger,
): LocalTransport { ): LocalTransport {
// Ensure we can authenticate with the SFU. // Ensure we can authenticate with the SFU.
const authenticatedOldestMemberTransport$ = oldestMemberTransport$.pipe( const authenticatedOldestMemberTransport$ = oldestMemberTransport$.pipe(
@@ -355,6 +362,7 @@ function observeLocalTransportForOldestMembership(
roomId, roomId,
client, client,
undefined, undefined,
logger,
), ),
).pipe( ).pipe(
catchError((e: unknown) => { catchError((e: unknown) => {

View File

@@ -22,8 +22,6 @@ import {
} from "../../../utils/displayname"; } from "../../../utils/displayname";
import { type Behavior } from "../../Behavior"; import { type Behavior } from "../../Behavior";
const logger = rootLogger.getChild("[MatrixMemberMetadata]");
export type RoomMemberMap = Map< export type RoomMemberMap = Map<
string, string,
Pick<RoomMember, "userId" | "getMxcAvatarUrl" | "rawDisplayName"> Pick<RoomMember, "userId" | "getMxcAvatarUrl" | "rawDisplayName">
@@ -67,6 +65,7 @@ export const memberDisplaynames$ = (
memberships$: Behavior<Pick<CallMembership, "userId">[]>, memberships$: Behavior<Pick<CallMembership, "userId">[]>,
roomMembers$: Behavior<RoomMemberMap>, roomMembers$: Behavior<RoomMemberMap>,
): Behavior<Map<string, string>> => { ): Behavior<Map<string, string>> => {
const logger = rootLogger.getChild("[MatrixMemberMetadata]");
// This map tracks userIds that at some point needed disambiguation. // This map tracks userIds that at some point needed disambiguation.
// This is a memory leak bound to the number of participants. // This is a memory leak bound to the number of participants.
// A call application will always increase the memory if there have been more members in a call. // A call application will always increase the memory if there have been more members in a call.