feat(federation): preserve effective displayName across profile_update relay

FederationProfileUpdatePayload gains `username`: the home user's canonical
handle. Receiver applies displayName ?? username so stubs whose home user has
no displayName show the real handle instead of getting clobbered to null.
Mirrors the existing fallback in hydrateReplicatedUserProfile. Username itself
is immutable on the home instance, so the receiver does not rewrite the stub's
username column on profile_update.
This commit is contained in:
Jannis Braun
2026-05-05 15:48:56 +02:00
parent 1d353c994b
commit 097eb9a2ef
4 changed files with 142 additions and 3 deletions
+6
View File
@@ -972,6 +972,12 @@ export interface FederationProfileUpdatePayload {
homeUserId: string;
homeInstance: string;
profileUpdatedAt: number;
// Home user's canonical username (without @domain suffix). Receivers apply
// `displayName ?? username` so stubs whose home user has no displayName show
// the real handle instead of getting clobbered to null. Username itself is
// immutable on the home instance — receivers do NOT rewrite the stub's
// username column on profile_update.
username: string;
displayName: string | null;
avatar: string | null;
banner: string | null;