From 689e6dd36e92abc44d4cd53ff58e9182242c8122 Mon Sep 17 00:00:00 2001 From: Dylan Audius Date: Fri, 28 Aug 2026 12:00:08 -0700 Subject: [PATCH] fix(web): stop album tracks rendering a 12/31/69 date Entries in playlist_contents whose added-timestamp was never written carry time: 0. dayjs.unix(0) renders as 12/31/69, and because it is a truthy object it also defeats the `dateAdded || created_at` fallback in formatMetadata and the mobile CollectionPage, which was the guard that used to cover this case. The legacy collection lineup saga only assigned dateAdded when the timestamp was non-zero, leaving it undefined so the fallback fired. #14178 dropped that guard when it moved the page to tan-query, which is what surfaced the dates. Restore the intent at the source so both desktop and mobile pick it up. Albums are where this is visible because the desktop table uses the `date` column for albums and `addedDate` for playlists. Co-Authored-By: Claude Opus 5 --- packages/web/src/pages/collection-page/useCollectionPage.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/web/src/pages/collection-page/useCollectionPage.ts b/packages/web/src/pages/collection-page/useCollectionPage.ts index d7bc9af9055..3ea683de8f7 100644 --- a/packages/web/src/pages/collection-page/useCollectionPage.ts +++ b/packages/web/src/pages/collection-page/useCollectionPage.ts @@ -161,7 +161,11 @@ export const useCollectionPage = ( kind: Kind.TRACKS, id: trackId, uid: makeStableUid(Kind.TRACKS, trackId, COLLECTION_TRACKS_SOURCE), - dateAdded: dayjs.unix(time) + // `time` is 0 for entries whose added-timestamp was never written to + // playlist_contents. `dayjs.unix(0)` renders as 12/31/69 and, being a + // truthy object, also defeats the `dateAdded || created_at` fallback + // downstream — so fall back to the track's creation date here. + dateAdded: time ? dayjs.unix(time) : dayjs(t.created_at) } as CollectionTrack }) .filter((e): e is CollectionTrack => e !== null)