Change the livekit alias to just be the room id for backwards
compatibility.
This commit is contained in:
@@ -250,7 +250,18 @@ async function makeTransport(
|
|||||||
transport: {
|
transport: {
|
||||||
type: "livekit",
|
type: "livekit",
|
||||||
livekit_service_url: url,
|
livekit_service_url: url,
|
||||||
livekit_alias: sfuConfig.livekitAlias,
|
// WARNING PLS READ ME!!!
|
||||||
|
// This looks unintuitive especially considering that `sfuConfig.livekitAlias` exists.
|
||||||
|
// Why do we not use: `livekit_alias: sfuConfig.livekitAlias`
|
||||||
|
//
|
||||||
|
// - This is going to be used for sending our state event transport (focus_preferred)
|
||||||
|
// - In sticky events it is expected to NOT send this field at all. The transport is only the `type`, `livekit_service_url`
|
||||||
|
// - If we set it to the hased alias we get from the jwt, we will end up using the hashed alias as the body.roomId field
|
||||||
|
// in v0.16.0. (It will use oldest member transport. It is using the transport.livekit_alias as the body.roomId)
|
||||||
|
//
|
||||||
|
// TLDR this is a temporal fild that allow for comaptibilty but the spec expects it to not exists. (but its existance also does not break anything)
|
||||||
|
// It is just named poorly: It was intetended to be the actual alias. But now we do pseudonymys ids so we use a hashed alias.
|
||||||
|
livekit_alias: roomId,
|
||||||
},
|
},
|
||||||
sfuConfig,
|
sfuConfig,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -143,9 +143,13 @@ export function areLivekitTransportsEqual<T extends LivekitTransport>(
|
|||||||
t1: T | null,
|
t1: T | null,
|
||||||
t2: T | null,
|
t2: T | null,
|
||||||
): boolean {
|
): boolean {
|
||||||
if (t1 && t2) return t1.livekit_service_url === t2.livekit_service_url;
|
if (t1 && t2)
|
||||||
// In case we have different lk rooms in the same SFU (depends on the livekit authorization service)
|
return (
|
||||||
// It is only needed in case the livekit authorization service is not behaving as expected (or custom implementation)
|
t1.livekit_service_url === t2.livekit_service_url &&
|
||||||
|
// In case we have different lk rooms in the same SFU (depends on the livekit authorization service)
|
||||||
|
// It is only needed in case the livekit authorization service is not behaving as expected (or custom implementation)
|
||||||
|
t1.livekit_alias === t2.livekit_alias
|
||||||
|
);
|
||||||
if (!t1 && !t2) return true;
|
if (!t1 && !t2) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user