diff --git a/packages/server/src/routes/users.ts b/packages/server/src/routes/users.ts index b1fd04c5..b51fc6e1 100644 --- a/packages/server/src/routes/users.ts +++ b/packages/server/src/routes/users.ts @@ -361,7 +361,7 @@ export async function userRoutes(app: FastifyInstance): Promise { if (profileUpdatedAt !== undefined && typeof profileUpdatedAt === 'number') { const currentUser = db.select().from(schema.users).where(eq(schema.users.id, request.userId)).get(); if (currentUser) { - const storedTs = currentUser.profileUpdatedAt ?? currentUser.createdAt; + const storedTs = currentUser.profileUpdatedAt ?? 0; if (profileUpdatedAt < storedTs) { // Incoming data is older — return current state without updating return reply.code(200).send(sanitizeUser(currentUser, true)); diff --git a/packages/server/src/utils/sanitize.ts b/packages/server/src/utils/sanitize.ts index 7340fd55..a325479a 100644 --- a/packages/server/src/utils/sanitize.ts +++ b/packages/server/src/utils/sanitize.ts @@ -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,