From 6f3e48f4fbc1e959da54a58a10fbda53b178e5ba Mon Sep 17 00:00:00 2001 From: Haileyesus <118998054+blackmammoth@users.noreply.github.com> Date: Tue, 5 May 2026 21:27:15 +0300 Subject: [PATCH] refactor(sidebar): rely on canonical session lastActivity timestamps Sidebar session sorting and time labels currently normalize timestamps through getUpdatedTimestamp. That helper still checked session.updated_at as a fallback, but in the current project/session API shape the sidebar no longer receives raw DB session rows. Why this cleanup matters: - Sidebar session items are built from project payload SessionSummary objects, where lastActivity is already the canonical field. - The backend guarantees lastActivity is populated from updated_at ?? created_at ?? now before data reaches the client. - Keeping a client-side updated_at fallback implies mixed payload contracts and hides schema drift instead of surfacing it. - Removing the fallback narrows the UI contract to one timestamp source, which reduces ambiguity in session ordering and display-time logic. This change intentionally keeps behavior the same while making the dependency explicit: sidebar timestamp logic now reads only session.lastActivity. --- src/components/sidebar/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/sidebar/utils/utils.ts b/src/components/sidebar/utils/utils.ts index 7ac15afe..048c7e21 100644 --- a/src/components/sidebar/utils/utils.ts +++ b/src/components/sidebar/utils/utils.ts @@ -58,7 +58,7 @@ const getCreatedTimestamp = (session: SessionWithProvider): string => { }; const getUpdatedTimestamp = (session: SessionWithProvider): string => { - return String(session.lastActivity || session.updated_at || ''); + return String(session.lastActivity || ''); }; export const getSessionDate = (session: SessionWithProvider): Date => {