lots of error logging and fixing playwright
This commit is contained in:
@@ -446,6 +446,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
|
|
||||||
let body: ReactNode;
|
let body: ReactNode;
|
||||||
if (externalError) {
|
if (externalError) {
|
||||||
|
logger.debug("External error occurred:", externalError);
|
||||||
// If an error was recorded within this component but outside
|
// If an error was recorded within this component but outside
|
||||||
// GroupCallErrorBoundary, create a component that rethrows the error from
|
// GroupCallErrorBoundary, create a component that rethrows the error from
|
||||||
// within the error boundary, so it can be handled uniformly
|
// within the error boundary, so it can be handled uniformly
|
||||||
|
|||||||
@@ -127,6 +127,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");
|
||||||
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 } =
|
||||||
@@ -153,6 +154,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
|||||||
vm.leave$.pipe(scope.bind()).subscribe(props.onLeft);
|
vm.leave$.pipe(scope.bind()).subscribe(props.onLeft);
|
||||||
|
|
||||||
return (): void => {
|
return (): void => {
|
||||||
|
logger.info("END CALL VIEW SCOPE");
|
||||||
scope.end();
|
scope.end();
|
||||||
};
|
};
|
||||||
}, [
|
}, [
|
||||||
@@ -271,7 +273,10 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
const ringOverlay = useBehavior(vm.ringOverlay$);
|
const ringOverlay = useBehavior(vm.ringOverlay$);
|
||||||
const fatalCallError = useBehavior(vm.fatalError$);
|
const fatalCallError = useBehavior(vm.fatalError$);
|
||||||
// Stop the rendering and throw for the error boundary
|
// Stop the rendering and throw for the error boundary
|
||||||
if (fatalCallError) throw fatalCallError;
|
if (fatalCallError) {
|
||||||
|
logger.debug("fatalCallError stop rendering", fatalCallError);
|
||||||
|
throw fatalCallError;
|
||||||
|
}
|
||||||
|
|
||||||
// We need to set the proper timings on the animation based upon the sound length.
|
// We need to set the proper timings on the animation based upon the sound length.
|
||||||
const ringDuration = pickupPhaseAudio?.soundDuration["waiting"] ?? 1;
|
const ringDuration = pickupPhaseAudio?.soundDuration["waiting"] ?? 1;
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ export const LobbyView: FC<Props> = ({
|
|||||||
waitingForInvite,
|
waitingForInvite,
|
||||||
}) => {
|
}) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
logger.info("[Lifecycle] GroupCallView Component mounted");
|
logger.info("[Lifecycle] LobbyView Component mounted");
|
||||||
return (): void => {
|
return (): void => {
|
||||||
logger.info("[Lifecycle] GroupCallView Component unmounted");
|
logger.info("[Lifecycle] LobbyView Component unmounted");
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
} from "livekit-client";
|
} from "livekit-client";
|
||||||
import { type Room as MatrixRoom } from "matrix-js-sdk";
|
import { type Room as MatrixRoom } from "matrix-js-sdk";
|
||||||
import {
|
import {
|
||||||
|
catchError,
|
||||||
combineLatest,
|
combineLatest,
|
||||||
distinctUntilChanged,
|
distinctUntilChanged,
|
||||||
filter,
|
filter,
|
||||||
@@ -425,7 +426,18 @@ export function createCallViewModel$(
|
|||||||
connectionFactory: connectionFactory,
|
connectionFactory: connectionFactory,
|
||||||
inputTransports$: scope.behavior(
|
inputTransports$: scope.behavior(
|
||||||
combineLatest(
|
combineLatest(
|
||||||
[localTransport$, membershipsAndTransports.transports$],
|
[
|
||||||
|
localTransport$.pipe(
|
||||||
|
catchError((e) => {
|
||||||
|
logger.info(
|
||||||
|
"dont pass local transport to createConnectionManager$. localTransport$ threw an error",
|
||||||
|
e,
|
||||||
|
);
|
||||||
|
return of(null);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
membershipsAndTransports.transports$,
|
||||||
|
],
|
||||||
(localTransport, transports) => {
|
(localTransport, transports) => {
|
||||||
const localTransportAsArray = localTransport ? [localTransport] : [];
|
const localTransportAsArray = localTransport ? [localTransport] : [];
|
||||||
return transports.mapInner((transports) => [
|
return transports.mapInner((transports) => [
|
||||||
@@ -1461,6 +1473,7 @@ export function createCallViewModel$(
|
|||||||
fatalError$: scope.behavior(
|
fatalError$: scope.behavior(
|
||||||
errors$.pipe(
|
errors$.pipe(
|
||||||
map((errors) => {
|
map((errors) => {
|
||||||
|
logger.debug("errors$ to compute any fatal errors:", errors);
|
||||||
return (
|
return (
|
||||||
errors?.transportError ??
|
errors?.transportError ??
|
||||||
errors?.matrixError ??
|
errors?.matrixError ??
|
||||||
|
|||||||
@@ -324,17 +324,23 @@ export const createLocalMembership$ = ({
|
|||||||
// These are non fatal since we can join a room and concume media even though publishing failed.
|
// These are non fatal since we can join a room and concume media even though publishing failed.
|
||||||
const publishError$ = new BehaviorSubject<ElementCallError | null>(null);
|
const publishError$ = new BehaviorSubject<ElementCallError | null>(null);
|
||||||
const setPublishError = (e: ElementCallError): void => {
|
const setPublishError = (e: ElementCallError): void => {
|
||||||
if (publishError$.value !== null) logger.error("Multiple Media Errors:", e);
|
if (publishError$.value !== null) {
|
||||||
else publishError$.next(e);
|
logger.error("Multiple Media Errors:", e);
|
||||||
|
} else {
|
||||||
|
publishError$.next(e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const fatalTransportError$ = new BehaviorSubject<ElementCallError | null>(
|
const fatalTransportError$ = new BehaviorSubject<ElementCallError | null>(
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
|
|
||||||
const setTransportError = (e: ElementCallError): void => {
|
const setTransportError = (e: ElementCallError): void => {
|
||||||
if (fatalTransportError$.value !== null)
|
if (fatalTransportError$.value !== null) {
|
||||||
logger.error("Multiple Transport Errors:", e);
|
logger.error("Multiple Transport Errors:", e);
|
||||||
else fatalTransportError$.next(e);
|
} else {
|
||||||
|
fatalTransportError$.next(e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const localConnectionState$ = localConnection$.pipe(
|
const localConnectionState$ = localConnection$.pipe(
|
||||||
@@ -386,9 +392,11 @@ export const createLocalMembership$ = ({
|
|||||||
);
|
);
|
||||||
const fatalMatrixError$ = new BehaviorSubject<ElementCallError | null>(null);
|
const fatalMatrixError$ = new BehaviorSubject<ElementCallError | null>(null);
|
||||||
const setMatrixError = (e: ElementCallError): void => {
|
const setMatrixError = (e: ElementCallError): void => {
|
||||||
if (fatalMatrixError$.value !== null)
|
if (fatalMatrixError$.value !== null) {
|
||||||
logger.error("Multiple Matrix Errors:", e);
|
logger.error("Multiple Matrix Errors:", e);
|
||||||
else fatalMatrixError$.next(e);
|
} else {
|
||||||
|
fatalMatrixError$.next(e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const localMemberState$ = scope.behavior<LocalMemberState>(
|
const localMemberState$ = scope.behavior<LocalMemberState>(
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export const createLocalTransport$ = ({
|
|||||||
* The transport that we would personally prefer to publish on (if not for the
|
* The transport that we would personally prefer to publish on (if not for the
|
||||||
* transport preferences of others, perhaps).
|
* transport preferences of others, perhaps).
|
||||||
*
|
*
|
||||||
* @throws
|
* @throws MatrixRTCTransportMissingError | FailToGetOpenIdToken
|
||||||
*/
|
*/
|
||||||
const preferredTransport$: Behavior<LivekitTransport | null> = scope.behavior(
|
const preferredTransport$: Behavior<LivekitTransport | null> = scope.behavior(
|
||||||
customLivekitUrl.value$.pipe(
|
customLivekitUrl.value$.pipe(
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ import {
|
|||||||
import { type Behavior } from "../../Behavior.ts";
|
import { type Behavior } from "../../Behavior.ts";
|
||||||
import { type ObservableScope } from "../../ObservableScope.ts";
|
import { type ObservableScope } from "../../ObservableScope.ts";
|
||||||
import {
|
import {
|
||||||
|
ElementCallError,
|
||||||
InsufficientCapacityError,
|
InsufficientCapacityError,
|
||||||
SFURoomCreationRestrictedError,
|
SFURoomCreationRestrictedError,
|
||||||
|
UnknownCallError,
|
||||||
} from "../../../utils/errors.ts";
|
} from "../../../utils/errors.ts";
|
||||||
|
|
||||||
export type PublishingParticipant = LocalParticipant | RemoteParticipant;
|
export type PublishingParticipant = LocalParticipant | RemoteParticipant;
|
||||||
@@ -79,9 +81,9 @@ export enum ConnectionState {
|
|||||||
*/
|
*/
|
||||||
export class Connection {
|
export class Connection {
|
||||||
// Private Behavior
|
// Private Behavior
|
||||||
private readonly _state$ = new BehaviorSubject<ConnectionState | Error>(
|
private readonly _state$ = new BehaviorSubject<
|
||||||
ConnectionState.Initialized,
|
ConnectionState | ElementCallError
|
||||||
);
|
>(ConnectionState.Initialized);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current state of the connection to the media transport.
|
* The current state of the connection to the media transport.
|
||||||
@@ -131,6 +133,8 @@ export class Connection {
|
|||||||
this.stopped = false;
|
this.stopped = false;
|
||||||
try {
|
try {
|
||||||
this._state$.next(ConnectionState.FetchingConfig);
|
this._state$.next(ConnectionState.FetchingConfig);
|
||||||
|
// We should already have this information after creating the localTransport.
|
||||||
|
// It would probably be better to forward this here.
|
||||||
const { url, jwt } = await this.getSFUConfigWithOpenID();
|
const { url, jwt } = await this.getSFUConfigWithOpenID();
|
||||||
// If we were stopped while fetching the config, don't proceed to connect
|
// If we were stopped while fetching the config, don't proceed to connect
|
||||||
if (this.stopped) return;
|
if (this.stopped) return;
|
||||||
@@ -172,7 +176,9 @@ export class Connection {
|
|||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.debug(`Failed to connect to LiveKit room: ${error}`);
|
this.logger.debug(`Failed to connect to LiveKit room: ${error}`);
|
||||||
this._state$.next(error instanceof Error ? error : new Error(`${error}`));
|
this._state$.next(
|
||||||
|
error instanceof ElementCallError ? error : new UnknownCallError(error),
|
||||||
|
);
|
||||||
// Its okay to ignore the throw. The error is part of the state.
|
// Its okay to ignore the throw. The error is part of the state.
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user