fix(socials): drop the dead account_socials.id from /socials (keep social_id)
Merged
SW
4mo ago+31+31+01234567890123456789-2-2-0123456789
Part of recoupable/chat#1833 (enabler; same pattern as api#734). Base: main.
Problem
/api/artists/{id}/socials returns each profile with both id (account_socials.id, link row) and social_id (the socials PK). But POST /api/socials/{id}/scrape (and sub-resources) key on social_id — using the id field returns 404 "Social profile not found" for every platform (verified live on all of Apache's socials).
The id is functionally dead: only React key props + a docs entry referenced it; scrape + updateArtistSocials use social_id / the nested social.id (the PK).
Fix
- Drop
idfromAccountSocialResponse+flattenAccountSocials; keepsocial_idas the single identity. - No api consumer read the response
id(verified). Companion chat PR switches the two React keys (GetArtistSocialsResult.tsx,ArtistSocial.tsx) fromsocial.id→social.social_id— merge that first (or concurrently) to avoid a transient key-warning.
Tests (TDD)
- New RED→GREEN
flattenAccountSocials.test.ts: returnssocial_id, dropsid. lib/account+lib/artistsuites green (152); tsc + eslint clean (no socials-id type errors anywhere).
🤖 Generated with Claude Code
Summary by cubic
Remove the dead link-row id from /api/artists/{id}/socials and standardize on social_id, matching scrape endpoints and preventing 404s.
- Bug Fixes
- Dropped
idfromAccountSocialResponseandflattenAccountSocials; returnsocial_idonly. - Added test to ensure
social_idis present andidis omitted.
- Dropped