post merge fix

This commit is contained in:
Valere
2025-11-14 14:33:06 +01:00
parent 596205474c
commit 7cd9dd7acb
3 changed files with 36 additions and 38 deletions

View File

@@ -229,7 +229,7 @@ export class CallViewModel {
private connectionManager = createConnectionManager$({ private connectionManager = createConnectionManager$({
scope: this.scope, scope: this.scope,
connectionFactory: this.connectionFactory, connectionFactory: this.connectionFactory,
inputTransports$: this.allTransports$, inputTransports$: this.membershipsAndTransports.transports$,
logger: logger, logger: logger,
}); });

View File

@@ -32,7 +32,7 @@ import {
switchMap, switchMap,
tap, tap,
} from "rxjs"; } from "rxjs";
import { type Logger, logger } from "matrix-js-sdk/lib/logger"; import { type Logger } from "matrix-js-sdk/lib/logger";
import { type Behavior } from "../../Behavior"; import { type Behavior } from "../../Behavior";
import { type IConnectionManager } from "../remoteMembers/ConnectionManager"; import { type IConnectionManager } from "../remoteMembers/ConnectionManager";
@@ -54,7 +54,7 @@ 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 } from "../remoteMembers/Connection.ts";
const logger = rootLogger.getChild("[LocalMembership]");
export enum LivekitState { export enum LivekitState {
Uninitialized = "uninitialized", Uninitialized = "uninitialized",
Connecting = "connecting", Connecting = "connecting",
@@ -220,39 +220,37 @@ export const createLocalMembership$ = ({
/** /**
* Whether we are connected to the MatrixRTC session. * Whether we are connected to the MatrixRTC session.
*/ */
const homeserverConnected$ = scope const homeserverConnected$ = scope.behavior(
.behavior( // To consider ourselves connected to MatrixRTC, we check the following:
// To consider ourselves connected to MatrixRTC, we check the following: and$(
and$( // The client is connected to the sync loop
// The client is connected to the sync loop (
( fromEvent(matrixRoom.client, ClientEvent.Sync) as Observable<
fromEvent(matrixRoom.client, ClientEvent.Sync) as Observable< [SyncState]
[SyncState] >
> ).pipe(
).pipe( startWith([matrixRoom.client.getSyncState()]),
startWith([matrixRoom.client.getSyncState()]), map(([state]) => state === SyncState.Syncing),
map(([state]) => state === SyncState.Syncing),
),
// Room state observed by session says we're connected
fromEvent(matrixRTCSession, MembershipManagerEvent.StatusChanged).pipe(
startWith(null),
map(() => matrixRTCSession.membershipStatus === Status.Connected),
),
// Also watch out for warnings that we've likely hit a timeout and our
// delayed leave event is being sent (this condition is here because it
// provides an earlier warning than the sync loop timeout, and we wouldn't
// see the actual leave event until we reconnect to the sync loop)
fromEvent(matrixRTCSession, MembershipManagerEvent.ProbablyLeft).pipe(
startWith(null),
map(() => matrixRTCSession.probablyLeft !== true),
),
), ),
) // Room state observed by session says we're connected
.pipe( fromEvent(matrixRTCSession, MembershipManagerEvent.StatusChanged).pipe(
startWith(null),
map(() => matrixRTCSession.membershipStatus === Status.Connected),
),
// Also watch out for warnings that we've likely hit a timeout and our
// delayed leave event is being sent (this condition is here because it
// provides an earlier warning than the sync loop timeout, and we wouldn't
// see the actual leave event until we reconnect to the sync loop)
fromEvent(matrixRTCSession, MembershipManagerEvent.ProbablyLeft).pipe(
startWith(null),
map(() => matrixRTCSession.probablyLeft !== true),
),
).pipe(
tap((connected) => { tap((connected) => {
prefixLogger.info(`Homeserver connected update: ${connected}`); prefixLogger.info(`Homeserver connected update: ${connected}`);
}), }),
); ),
);
// /** // /**
// * Whether we are "fully" connected to the call. Accounts for both the // * Whether we are "fully" connected to the call. Accounts for both the
@@ -609,10 +607,11 @@ async function enterRTCSession(
}, },
); );
if (widget) { if (widget) {
try { // try {
await widget.api.transport.send(ElementWidgetActions.JoinCall, {}); await widget.api.transport.send(ElementWidgetActions.JoinCall, {});
} catch (e) { // TODO Why catch and swallow?
logger.error("Failed to send join action", e); // } catch (e) {
} // logger.error("Failed to send join action", e);
// }
} }
} }

View File

@@ -19,7 +19,6 @@ import {
take, take,
takeUntil, takeUntil,
} from "rxjs"; } from "rxjs";
import { logger } from "matrix-js-sdk/lib/logger";
import { type Behavior } from "./Behavior"; import { type Behavior } from "./Behavior";