mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-08 20:09:19 +00:00
Better logs for connection/component lifecycle
This commit is contained in:
@@ -137,13 +137,16 @@ async function connectAndPublish(
|
|||||||
livekitRoom.once(RoomEvent.SignalConnected, tracker.cacheWsConnect);
|
livekitRoom.once(RoomEvent.SignalConnected, tracker.cacheWsConnect);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
logger.info(`[Lifecycle] Connecting to livekit room ${sfuConfig!.url} ...`);
|
||||||
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt, {
|
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt, {
|
||||||
// Due to stability issues on Firefox we are testing the effect of different
|
// Due to stability issues on Firefox we are testing the effect of different
|
||||||
// timeouts, and allow these values to be set through the console
|
// timeouts, and allow these values to be set through the console
|
||||||
peerConnectionTimeout: window.peerConnectionTimeout ?? 45000,
|
peerConnectionTimeout: window.peerConnectionTimeout ?? 45000,
|
||||||
websocketTimeout: window.websocketTimeout ?? 45000,
|
websocketTimeout: window.websocketTimeout ?? 45000,
|
||||||
});
|
});
|
||||||
|
logger.info(`[Lifecycle] ... connected to livekit room`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
logger.error("[Lifecycle] Failed to connect", e);
|
||||||
// LiveKit uses 503 to indicate that the server has hit its track limits.
|
// LiveKit uses 503 to indicate that the server has hit its track limits.
|
||||||
// https://github.com/livekit/livekit/blob/fcb05e97c5a31812ecf0ca6f7efa57c485cea9fb/pkg/service/rtcservice.go#L171
|
// https://github.com/livekit/livekit/blob/fcb05e97c5a31812ecf0ca6f7efa57c485cea9fb/pkg/service/rtcservice.go#L171
|
||||||
// It also errors with a status code of 200 (yes, really) for room
|
// It also errors with a status code of 200 (yes, really) for room
|
||||||
|
|||||||
@@ -118,6 +118,13 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
logger.info("[Lifecycle] GroupCallView Component mounted");
|
||||||
|
return (): void => {
|
||||||
|
logger.info("[Lifecycle] GroupCallView Component unmounted");
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.rtcSession = rtcSession;
|
window.rtcSession = rtcSession;
|
||||||
return (): void => {
|
return (): void => {
|
||||||
|
|||||||
@@ -127,10 +127,23 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
|||||||
const [vm, setVm] = useState<CallViewModel | null>(null);
|
const [vm, setVm] = useState<CallViewModel | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
logger.info(
|
||||||
|
`[Lifecycle] InCallView Component mounted, livekitroom state ${livekitRoom?.state}`,
|
||||||
|
);
|
||||||
return (): void => {
|
return (): void => {
|
||||||
livekitRoom?.disconnect().catch((e) => {
|
logger.info(
|
||||||
logger.error("Failed to disconnect from livekit room", e);
|
`[Lifecycle] InCallView Component unmounted, livekitroom state ${livekitRoom?.state}`,
|
||||||
});
|
);
|
||||||
|
livekitRoom
|
||||||
|
?.disconnect()
|
||||||
|
.then(() => {
|
||||||
|
logger.info(
|
||||||
|
`[Lifecycle] Disconnected from livekite room, state:${livekitRoom?.state}`,
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
logger.error("[Lifecycle] Failed to disconnect from livekit room", e);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -5,7 +5,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|||||||
Please see LICENSE in the repository root for full details.
|
Please see LICENSE in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { type FC, useCallback, useMemo, useState, type JSX } from "react";
|
import {
|
||||||
|
type FC,
|
||||||
|
useCallback,
|
||||||
|
useMemo,
|
||||||
|
useState,
|
||||||
|
type JSX,
|
||||||
|
useEffect,
|
||||||
|
} from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { type MatrixClient } from "matrix-js-sdk";
|
import { type MatrixClient } from "matrix-js-sdk";
|
||||||
import { Button } from "@vector-im/compound-web";
|
import { Button } from "@vector-im/compound-web";
|
||||||
@@ -72,6 +79,13 @@ export const LobbyView: FC<Props> = ({
|
|||||||
onShareClick,
|
onShareClick,
|
||||||
waitingForInvite,
|
waitingForInvite,
|
||||||
}) => {
|
}) => {
|
||||||
|
useEffect(() => {
|
||||||
|
logger.info("[Lifecycle] GroupCallView Component mounted");
|
||||||
|
return (): void => {
|
||||||
|
logger.info("[Lifecycle] GroupCallView Component unmounted");
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
usePageTitle(matrixInfo.roomName);
|
usePageTitle(matrixInfo.roomName);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user