fix: persist homeUserId for federated users to ensure consistent avatar colors

Store the original home snowflake ID (homeUserId) during federation replication
so that avatar gradient colors resolve identically across instances. Previously,
replicated users got new snowflake IDs on each instance, causing different
gradient colors. Now Avatar, UserProfilePopout, VoiceUser, StreamTile, and
VoiceChannel all resolve through homeUserId when available. Includes backfill
logic for existing federated users missing the field.
This commit is contained in:
Jannis Braun
2026-03-04 13:45:25 +01:00
parent 9432f81ba3
commit c7c3331dbf
15 changed files with 47 additions and 22 deletions
@@ -1,7 +1,6 @@
import React, { useRef, useEffect, useState, useCallback } from 'react';
import { Avatar } from '../ui/Avatar';
import { useVoiceStore } from '../../stores/voiceStore';
import { useAuthStore } from '../../stores/authStore';
import type { UserTile } from '../../hooks/useLiveKit';
interface VoiceUserProps {
@@ -21,8 +20,7 @@ export function VoiceUser({ tile, large }: VoiceUserProps) {
const perUserVolume = participantVolumes.get(participant.userId) ?? 100;
const isLocal = participant.isLocal;
const homeUser = useAuthStore((s) => s.user);
const avatarUserId = isLocal ? (homeUser?.id ?? participant.userId) : participant.userId;
const avatarUserId = participant.homeUserId ?? participant.userId;
// --- VIDEO & UI ---