fix(federation): resolve persistent unread indicator on federated DMs
Federated relay messages can have local snowflake IDs that don't match chronological (createdAt) order — a message sent earlier on a remote instance can arrive later and get a higher local ID. This caused a permanent mismatch between the ready event's lastMessage (MAX id) and the acked message (last in createdAt display order), making federated DM channels appear unread after every server restart. - Server: change ready event DM lastMessage query from MAX(id) to ORDER BY created_at DESC (matching the DM REST API) - Frontend: change ackChannel to ack MAX(id) among loaded messages instead of last in display order (consistent with server comparison) - Fix federated username display fallback in UserDiscoverCard
This commit is contained in:
@@ -625,8 +625,8 @@ function UserDiscoverCard({
|
||||
username: string;
|
||||
} | null>(null);
|
||||
|
||||
const displayName = user.displayName ?? user.username;
|
||||
const baseName = user.username.includes('@') ? user.username.split('@')[0]! : user.username;
|
||||
const displayName = user.displayName ?? baseName;
|
||||
const gradient = getAvatarGradient(user.homeUserId ?? user.id, displayName, user.avatarColor);
|
||||
const originLabel = user._instanceOrigin
|
||||
? (() => { try { return new URL(user._instanceOrigin).host; } catch { return user._instanceOrigin; } })()
|
||||
|
||||
Reference in New Issue
Block a user