fix(web): stop album tracks rendering a 12/31/69 date - #14579
Merged
Conversation
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 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tracks inside albums render their date as 12/31/69. Reported by Michael from support email (Slack), with three examples:
Root cause
The API is returning
playlist_contents[].timestamp: 0for exactly the rows that render as 1969 — a long-standing data condition, not new:What changed is that the client stopped defending against it. The legacy collection lineup saga only assigned
dateAddedwhen the timestamp was non-zero:leaving it
undefinedon a zero so the downstream fallback fired:#14178 ("Drop legacy lineup system") rewrote this tan-query-first and dropped the guard, always assigning
dayjs.unix(time).dayjs.unix(0)is a truthy object, so the|| created_atfallback in bothformatMetadataand the mobileCollectionPagebecame dead code.Albums only, as reported, because
desktop/CollectionPage.tsxpicks the column by type —isAlbum ? 'date' : 'addedDate'— anddateis the one carrying the dead fallback.Fix
Restore the intent at the source, so desktop and mobile both pick it up:
Note for review
onReorderTrackswritesdateAdded.unix()back on-chain. With this change, reordering an affected album persists the track'screated_atinstead of0— a heal rather than a corruption, but it is a write side-effect of a display fix and worth a conscious ack. (The prior code path would have written the0straight back.)No regression test:
useCollectionPagehas no existing test harness and pulls in the redux store, tan-query and the playback slice, so covering this one-line fallback would mean standing up substantial mocking.Separate follow-up
Why some
playlist_contentsentries never get atimewritten is a server-side question this PR does not address.canonicalizePlaylistEntryin go-openaudio's ETL only emitstimewhen the client sends one, with no block-time default — worth its own look.Test plan
tsc --noEmitonpackages/web— no errors incollection-page(remaining errors are pre-existing unbuilt-workspace noise)🤖 Generated with Claude Code