playwright: Fix error boundary mgmt or openId errors (#3570)
* playwright: Fix error boundary mgmt or openId errors * do not use tap for important logic * fix lint --------- Co-authored-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -22,6 +22,7 @@ import { ClientEvent, SyncState, type Room as MatrixRoom } from "matrix-js-sdk";
|
|||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
combineLatest,
|
combineLatest,
|
||||||
|
distinctUntilChanged,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
map,
|
map,
|
||||||
type Observable,
|
type Observable,
|
||||||
@@ -41,7 +42,7 @@ import { type MuteStates } from "../../MuteStates";
|
|||||||
import { type ProcessorState } from "../../../livekit/TrackProcessorContext";
|
import { type ProcessorState } from "../../../livekit/TrackProcessorContext";
|
||||||
import { type MediaDevices } from "../../MediaDevices";
|
import { type MediaDevices } from "../../MediaDevices";
|
||||||
import { and$ } from "../../../utils/observable";
|
import { and$ } from "../../../utils/observable";
|
||||||
import { type ElementCallError } from "../../../utils/errors";
|
import { ElementCallError, UnknownCallError } from "../../../utils/errors";
|
||||||
import {
|
import {
|
||||||
ElementWidgetActions,
|
ElementWidgetActions,
|
||||||
widget,
|
widget,
|
||||||
@@ -52,7 +53,10 @@ import { getUrlParams } from "../../../UrlParams.ts";
|
|||||||
import { PosthogAnalytics } from "../../../analytics/PosthogAnalytics.ts";
|
import { PosthogAnalytics } from "../../../analytics/PosthogAnalytics.ts";
|
||||||
import { MatrixRTCMode } from "../../../settings/settings.ts";
|
import { MatrixRTCMode } from "../../../settings/settings.ts";
|
||||||
import { Config } from "../../../config/Config.ts";
|
import { Config } from "../../../config/Config.ts";
|
||||||
import { type Connection } from "../remoteMembers/Connection.ts";
|
import {
|
||||||
|
type Connection,
|
||||||
|
type ConnectionState,
|
||||||
|
} from "../remoteMembers/Connection.ts";
|
||||||
|
|
||||||
export enum LivekitState {
|
export enum LivekitState {
|
||||||
Uninitialized = "uninitialized",
|
Uninitialized = "uninitialized",
|
||||||
@@ -446,8 +450,8 @@ export const createLocalMembership$ = ({
|
|||||||
scope.reconcile(localTransport$, async (advertised) => {
|
scope.reconcile(localTransport$, async (advertised) => {
|
||||||
if (advertised !== null && advertised !== undefined) {
|
if (advertised !== null && advertised !== undefined) {
|
||||||
try {
|
try {
|
||||||
configError$.next(null);
|
|
||||||
await enterRTCSession(matrixRTCSession, advertised, options.value);
|
await enterRTCSession(matrixRTCSession, advertised, options.value);
|
||||||
|
configError$.next(null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Error entering RTC session", e);
|
logger.error("Error entering RTC session", e);
|
||||||
}
|
}
|
||||||
@@ -477,6 +481,28 @@ export const createLocalMembership$ = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
localConnection$
|
||||||
|
.pipe(
|
||||||
|
distinctUntilChanged(),
|
||||||
|
switchMap((c) =>
|
||||||
|
c === null ? of({ state: "Initialized" } as ConnectionState) : c.state$,
|
||||||
|
),
|
||||||
|
map((s) => {
|
||||||
|
logger.trace(`Local connection state update: ${s.state}`);
|
||||||
|
if (s.state == "FailedToStart") {
|
||||||
|
return s.error instanceof ElementCallError
|
||||||
|
? s.error
|
||||||
|
: new UnknownCallError(s.error);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
scope.bind(),
|
||||||
|
)
|
||||||
|
.subscribe((fatalError) => {
|
||||||
|
configError$.next(fatalError);
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the user is currently sharing their screen.
|
* Whether the user is currently sharing their screen.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -166,10 +166,14 @@ async function makeTransport(
|
|||||||
): Promise<LivekitTransport> {
|
): Promise<LivekitTransport> {
|
||||||
const transport = await makeTransportInternal(client, roomId);
|
const transport = await makeTransportInternal(client, roomId);
|
||||||
// this will call the jwt/sfu/get endpoint to pre create the livekit room.
|
// this will call the jwt/sfu/get endpoint to pre create the livekit room.
|
||||||
await getSFUConfigWithOpenID(
|
try {
|
||||||
client,
|
await getSFUConfigWithOpenID(
|
||||||
transport.livekit_service_url,
|
client,
|
||||||
transport.livekit_alias,
|
transport.livekit_service_url,
|
||||||
);
|
transport.livekit_alias,
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn(`Failed to get SFU config for transport: ${e}`);
|
||||||
|
}
|
||||||
return transport;
|
return transport;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user