fix(genesis): carry the entity fields the writer never put on Create - #445
Merged
Conversation
Three groups of source columns never reached the chain.
Tracks and playlists lost their DDEX rights metadata: the writer selected
neither the contributor lists nor the copyright and rights-controller records,
so they could not be indexed no matter what the indexer read. The DDEX
processor sets all of them on sdk.tracks.uploadTrack and sdk.albums.uploadAlbum
today, so this is live metadata, not a legacy shape.
Users lost playlist_library, artist_pick_track_id and allow_ai_attribution.
These are the awkward case: the indexer honors them only on User:Update,
because a live client only ever sends them by editing a profile. Among the
292,111 users on a production clone never modified after creation,
artist_pick_track_id and allow_ai_attribution appear exactly zero times. A
migrated Create is different in kind -- it carries an account's final state,
not a signup -- so the migration create override now accepts them. The
production create handler still ignores them, and a test pins both halves.
Emitting them on Create rather than as a follow-up User:Update keeps the
genesis 637,899 transactions smaller and avoids modelling an edit that never
happened.
Counts below exclude jsonb columns holding the literal `null`, which these
tables use heavily in place of SQL NULL:
tracks producer_copyright_line 1,459 parental_warning_type 1,459
artists 1,447 rights_controller 1,404 copyright_line 782
indirect_resource_contributors 782 resource_contributors 686
playlists artists 143 ddex_release_ids 143
copyright_line 28 producer_copyright_line 28
users playlist_library 622,480 artist_pick_track_id 13,935
allow_ai_attribution 1,484
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 6, 2026
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.
Three groups of source columns never reached the chain because genesis-writer did not select them, or because the field only exists on an action the migration never emits.
Tracks and playlists — DDEX rights metadata
The writer selected neither the contributor lists nor the copyright and rights-controller records, so they could not be indexed regardless of what the indexer reads. Added to the
Createmetadata for both:artistsartistsresource_contributorsddex_release_idsindirect_resource_contributorscopyright_linerights_controllerproducer_copyright_linecopyright_lineproducer_copyright_lineparental_warning_typeThis is live metadata, not a legacy shape:
ddex-processor/src/publishRelease.tssets every one of these onsdk.tracks.uploadTrackandsdk.albums.uploadAlbumtoday.Users — fields the indexer only honors on Update
playlist_library,artist_pick_track_idandallow_ai_attributionare read byuser_update.goand ignored byuser_create.go. That is correct for production — a live client sets them by editing a profile, never at signup. Among the 292,111 users on a production clone never modified after creation,artist_pick_track_idandallow_ai_attributionappear exactly zero times.A migrated
Createis different in kind: it carries an account's final state, not a signup. SomigratedUserCreateHandlernow accepts them, via three new fields onuserStatethat the production path leaves at their zero values.TestMigratedUserCreate_CarriesUpdateOnlyProfileFieldspins both halves: the migration path writes them, the production path does not.Why not a follow-up
User:Updatetransaction?That was the first cut. Emitting them on
Createinstead keeps 637,899 transactions out of genesis and avoids modelling a profile edit that never happened. The indexer change is confined to the migration override, so production create semantics are untouched either way.Counts
Excluding jsonb columns holding the literal
null— these tables use it heavily in place of SQLNULL, andIS NOT NULLcounts them:JSON
nullvalues are dropped automatically:unmarshalJSONBdecodes them to a nilinterface{}, whichomitemptyomits.Out of scope
is_original_available(28,827 tracks) is already emitted by the writer and dropped by the indexer, along with seven track DDEX readers this PR now feeds. That is an indexer-side gap that also affects live uploads, and it ships separately.🤖 Generated with Claude Code