Merge pull request #3670 from element-hq/toger5/livekitAlias-debugging-info

Add livekitAlias debugging info
This commit is contained in:
Timo
2026-01-14 12:26:50 +01:00
committed by GitHub
5 changed files with 30 additions and 3 deletions

View File

@@ -842,6 +842,7 @@ export const InCallView: FC<InCallViewProps> = ({
.getConnections() .getConnections()
.map((connectionItem) => ({ .map((connectionItem) => ({
room: connectionItem.livekitRoom, room: connectionItem.livekitRoom,
livekitAlias: connectionItem.livekitAlias,
// TODO compute is local or tag it in the livekit room items already // TODO compute is local or tag it in the livekit room items already
isLocal: undefined, isLocal: undefined,
url: connectionItem.transport.livekit_service_url, url: connectionItem.transport.livekit_service_url,

View File

@@ -25,7 +25,7 @@ function createMockLivekitRoom(
wsUrl: string, wsUrl: string,
serverInfo: object, serverInfo: object,
metadata: string, metadata: string,
): { isLocal: boolean; url: string; room: LivekitRoom } { ): { isLocal: boolean; url: string; room: LivekitRoom; livekitAlias: string } {
const mockRoom = { const mockRoom = {
serverInfo, serverInfo,
metadata, metadata,
@@ -38,6 +38,7 @@ function createMockLivekitRoom(
isLocal: true, isLocal: true,
url: wsUrl, url: wsUrl,
room: mockRoom, room: mockRoom,
livekitAlias: "TestAlias",
}; };
} }
@@ -61,6 +62,7 @@ describe("DeveloperSettingsTab", () => {
room: LivekitRoom; room: LivekitRoom;
url: string; url: string;
isLocal?: boolean; isLocal?: boolean;
livekitAlias: string;
}[] = [ }[] = [
createMockLivekitRoom( createMockLivekitRoom(
"wss://local-sfu.example.org", "wss://local-sfu.example.org",
@@ -69,6 +71,7 @@ describe("DeveloperSettingsTab", () => {
), ),
{ {
isLocal: false, isLocal: false,
livekitAlias: "TestAlias2",
url: "wss://remote-sfu.example.org", url: "wss://remote-sfu.example.org",
room: { room: {
localParticipant: { identity: "localParticipantIdentity" }, localParticipant: { identity: "localParticipantIdentity" },

View File

@@ -48,7 +48,12 @@ import { useUrlParams } from "../UrlParams";
interface Props { interface Props {
client: MatrixClient; client: MatrixClient;
livekitRooms?: { room: LivekitRoom; url: string; isLocal?: boolean }[]; livekitRooms?: {
room: LivekitRoom;
url: string;
isLocal?: boolean;
livekitAlias?: string;
}[];
env: ImportMetaEnv; env: ImportMetaEnv;
} }
@@ -310,6 +315,7 @@ export const DeveloperSettingsTab: FC<Props> = ({
url: livekitRoom.url || "unknown", url: livekitRoom.url || "unknown",
})} })}
</h4> </h4>
<p>LivekitAlias: {livekitRoom.livekitAlias}</p>
{livekitRoom.isLocal && <p>ws-url: {localSfuUrl?.href}</p>} {livekitRoom.isLocal && <p>ws-url: {localSfuUrl?.href}</p>}
<p> <p>
{t("developer_mode.livekit_server_info")}( {t("developer_mode.livekit_server_info")}(

View File

@@ -355,6 +355,10 @@ exports[`DeveloperSettingsTab > renders and matches snapshot 1`] = `
<h4> <h4>
LiveKit SFU: wss://local-sfu.example.org LiveKit SFU: wss://local-sfu.example.org
</h4> </h4>
<p>
LivekitAlias:
TestAlias
</p>
<p> <p>
ws-url: ws-url:
wss://local-sfu.example.org/ wss://local-sfu.example.org/
@@ -393,6 +397,10 @@ exports[`DeveloperSettingsTab > renders and matches snapshot 1`] = `
<h4> <h4>
LiveKit SFU: wss://remote-sfu.example.org LiveKit SFU: wss://remote-sfu.example.org
</h4> </h4>
<p>
LivekitAlias:
TestAlias2
</p>
<p> <p>
LiveKit Server Info LiveKit Server Info
( (

View File

@@ -117,6 +117,14 @@ export class Connection {
*/ */
public readonly remoteParticipants$: Behavior<RemoteParticipant[]>; public readonly remoteParticipants$: Behavior<RemoteParticipant[]>;
/**
* The alias of the LiveKit room.
*/
public get livekitAlias(): string | undefined {
return this._livekitAlias;
}
private _livekitAlias?: string;
/** /**
* Whether the connection has been stopped. * Whether the connection has been stopped.
* @see Connection.stop * @see Connection.stop
@@ -144,9 +152,10 @@ export class Connection {
this._state$.next(ConnectionState.FetchingConfig); this._state$.next(ConnectionState.FetchingConfig);
// We should already have this information after creating the localTransport. // We should already have this information after creating the localTransport.
// only call getSFUConfigWithOpenID for connections where we do not have a token yet. (existingJwtTokenData === undefined) // only call getSFUConfigWithOpenID for connections where we do not have a token yet. (existingJwtTokenData === undefined)
const { url, jwt } = const { url, jwt, livekitAlias } =
this.existingSFUConfig ?? this.existingSFUConfig ??
(await this.getSFUConfigForRemoteConnection()); (await this.getSFUConfigForRemoteConnection());
this._livekitAlias = livekitAlias;
// 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;