Skip to content

fix(api): accept coin_flair_mint when creating a user - #1012

Merged
rickyrombo merged 2 commits into
mainfrom
fix/create-user-coin-flair-mint
Aug 8, 2026
Merged

fix(api): accept coin_flair_mint when creating a user#1012
rickyrombo merged 2 commits into
mainfrom
fix/create-user-coin-flair-mint

Conversation

@rickyrombo

Copy link
Copy Markdown
Contributor

The gap

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. NULL for auto, empty string for none.

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:

Migration Field In create body?
0141 profile_type yes
0175 coin_flair_mint no
0200 spl_usdc_payout_wallet yes

The one in the middle is the only one missing.

Result

Create and update now differ by exactly the fields that should differ:

create-only : user_id, wallet
update-only : artist_pick_track_id, is_deactivated

Both update-only fields have reasons independent of any schema:

  • 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.
  • is_deactivated — creating an already-deactivated account is meaningless.

Verification

Parsed the modified document with js-yaml:

YAML parses OK
create has coin_flair_mint: true
create fields: 21   update fields: 21
update-only: is_deactivated, artist_pick_track_id

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 CreateUserSchema is a separate hand-written contract that's also missing coin_flair_mint (and profile_type); worth a follow-up there.

🤖 Generated with Claude Code

rickyrombo and others added 2 commits August 7, 2026 01:54
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>
@rickyrombo

Copy link
Copy Markdown
Contributor Author

Follow-up in ea4ade4: the swagger doc alone wasn't enough. The handler parses into CreateUserRequest and rebuilds the entity-manager metadata by re-marshaling that struct, so an unknown coin_flair_mint field was silently dropped at parse time and never reached the transaction. Added the field to the struct so create actually passes it through; UpdateUserRequest already had it.

@rickyrombo
rickyrombo merged commit 1255e2d into main Aug 8, 2026
1 of 2 checks passed
@rickyrombo
rickyrombo deleted the fix/create-user-coin-flair-mint branch August 8, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant