fix: use timestamp 0 for never-edited profiles in LWW comparisons
profileUpdatedAt ?? createdAt treated freshly registered users as having "newer" profiles than users with real edit history, because createdAt is always NOW at registration time. This broke federation profile sync: the client correctly pushed home → remote, but the remote server's LWW guard rejected the write (stored createdAt > incoming profileUpdatedAt). A null profileUpdatedAt means "never edited" — that's timestamp 0, not the user's creation time.
This commit is contained in:
@@ -49,7 +49,7 @@ export function sanitizeUser(row: typeof schema.users.$inferSelect, isSelf = fal
|
||||
customStatus: row.customStatus,
|
||||
isAdmin: row.isAdmin === 1,
|
||||
discoverable: row.discoverable !== 0,
|
||||
profileUpdatedAt: row.profileUpdatedAt ?? row.createdAt,
|
||||
profileUpdatedAt: row.profileUpdatedAt ?? 0,
|
||||
createdAt: row.createdAt,
|
||||
homeInstance: row.homeInstance ?? null,
|
||||
homeUserId: row.homeUserId ?? null,
|
||||
|
||||
Reference in New Issue
Block a user