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.
This commit is contained in:
Haileyesus
2026-05-05 21:27:15 +03:00
parent 41e221f1b3
commit 6f3e48f4fb

View File

@@ -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 => {