fix(api): accept coin_flair_mint when creating a user - #1012
Merged
Conversation
update_user_request_body has carried coin_flair_mint since 0175; the create body never did. Nothing about the field explains the difference -- the column comment describes it as "the coin which the user has selected as their preferred flair", a display preference in the same shape as spl_usdc_payout_wallet, which is accepted on create. The ordering makes an oversight the likelier reading than intent: 0141 added profile_type and 0175 coin_flair_mint and 0200 spl_usdc_payout_wallet, and the one in the middle is the only one missing from the create body. With this, create and update differ by exactly the fields that should differ: user_id and wallet are create-only, artist_pick_track_id and is_deactivated update-only. artist_pick_track_id references a track the account cannot own at signup -- across 292,111 users never modified after creation it appears zero times -- and creating an already-deactivated account is meaningless. Found while auditing the indexer, which was dropping four fields the create body already accepted (OpenAudio/go-openaudio#466). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Follow-up in ea4ade4: the swagger doc alone wasn't enough. The handler parses into |
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.
The gap
update_user_request_bodyhas carriedcoin_flair_mintsince0175. The create body never did.Nothing about the field explains the difference. The column comment describes it as:
That's a display preference — the same shape as
spl_usdc_payout_wallet, which is accepted on create.The ordering makes oversight the likelier reading than intent:
0141profile_type0175coin_flair_mint0200spl_usdc_payout_walletThe one in the middle is the only one missing.
Result
Create and update now differ by exactly the fields that should differ:
Both update-only fields have reasons independent of any schema:
artist_pick_track_idreferences a track the account cannot own at signup. Across 292,111 users never modified after creation, it appears zero times.is_deactivated— creating an already-deactivated account is meaningless.Verification
Parsed the modified document with
js-yaml:Three lines, response schemas untouched.
Context
Found while auditing the indexer, which was dropping four fields the create body already accepted —
profile_type,allow_ai_attribution,spl_usdc_payout_wallet,playlist_library. Fixed in OpenAudio/go-openaudio#466, which also adds a test pinning the indexer's create and update column sets together. This PR closes the same gap one layer up so all three layers — API contract, SDK schema, indexer — agree.The SDK's Zod
CreateUserSchemais a separate hand-written contract that's also missingcoin_flair_mint(andprofile_type); worth a follow-up there.🤖 Generated with Claude Code