fix(genesis-writer): emit release_date as RFC3339, not Postgres text - #519
Merged
Merged
Conversation
The tracks query selected release_date::text, which yields Postgres's own "2026-09-06 22:06:00". The indexer's parseReleaseDate accepts RFC3339, RFC3339Nano and "Mon Jan 02 2006 15:04:05 GMT-0700" -- none of which match -- so releaseDateOrDefault silently fell back to block time, i.e. the source row's created_at. That is not a cosmetic date difference. A track whose release_date lands in the past is then picked up by ScheduledReleasePublisher, which sets is_unlisted = false and updated_at = now(). Measured on the 2026-08-07 snapshot: 372 unlisted tracks with a future release_date had the date rewritten 368 of them were published early 498 -> 136 tracks still holding a future release_date Verified end to end on track 2073330890: source release_date 2026-09-06 22:06:00 and is_unlisted true, the transaction carried both correctly, and the indexed row came out release_date 2025-08-10 20:57:26 (exactly its created_at) with is_unlisted false. Every other timestamp the writer emits already goes out as RFC3339; this one was the outlier.
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.
Unreleased tracks are published early
The tracks query selected
release_date::text, which yields Postgres's own2026-09-06 22:06:00. The indexer'sparseReleaseDateaccepts RFC3339,RFC3339Nano and
Mon Jan 02 2006 15:04:05 GMT-0700— none of which match — soreleaseDateOrDefaultsilently fell back to block time (the source row'screated_at).That is not a cosmetic date difference. One format mismatch produces three symptoms:
release_dateis rewritten from the future into the pastScheduledReleasePublisherthen matchesis_unlisted = true AND is_scheduled_release = true AND release_date <= now()and setsis_unlisted = falseupdated_at = now(), which is why some rows carried the replay wall-clockMeasured on the 2026-08-07 snapshot
is_unlistedflipped)Verified end to end — track
2073330890Fix
Scan
release_dateas a timestamp and format it RFC3339. Every other timestampthe writer emits already goes out as RFC3339 — this one was the outlier.
TestReleaseDateIsEmittedInAnAcceptedLayoutasserts the output parses under thelayout the indexer actually uses, and that the Postgres text shape cannot come back.
🤖 Generated with Claude Code