mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Key media tiles by the membership id
The bumped js-sdk reports the legacy identity as rtcBackendIdentity for every membership, so a device that rejoins after an improper leave, which has two memberships until the stale one expires, produced two tiles with the same key and crashed the call view. The membership id tells them apart; the audio renderer keys by it too.
This commit is contained in:
@@ -658,9 +658,13 @@ export function createCallViewModel$(
|
||||
function* ([members, duplicateTiles]) {
|
||||
for (const member of members) {
|
||||
const mediaId = `${member.userId}:${member.deviceId}`;
|
||||
// A device that rejoins after an improper leave has two
|
||||
// memberships until the stale one expires, so the key is the
|
||||
// membership's own id, which the backend identity no longer
|
||||
// tells apart
|
||||
for (let dup = 0; dup < 1 + duplicateTiles; dup++) {
|
||||
yield {
|
||||
keys: [dup, mediaId, member.rtcBackendIdentity],
|
||||
keys: [dup, mediaId, member.memberId],
|
||||
data: member,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export const MemberAudioRenderer: FC<MemberAudioRendererProps> = ({
|
||||
<div style={{ display: "none" }}>
|
||||
{members.map((member) => (
|
||||
<MemberAudio
|
||||
key={member.rtcBackendIdentity}
|
||||
key={member.memberId}
|
||||
tracks$={member.tracks$}
|
||||
muted={muted}
|
||||
plugins={plugins}
|
||||
|
||||
Reference in New Issue
Block a user