fix(socials): drop the dead account_socials.id from /socials (keep social_id)

Merged
SW
4mo ago
+31-2

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 id from AccountSocialResponse + flattenAccountSocials; keep social_id as the single identity.
  • No api consumer read the response id (verified). Companion chat PR switches the two React keys (GetArtistSocialsResult.tsx, ArtistSocial.tsx) from social.id → social.social_id — merge that first (or concurrently) to avoid a transient key-warning.

Tests (TDD)

  • New RED→GREEN flattenAccountSocials.test.ts: returns social_id, drops id.
  • lib/account + lib/artist suites 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 id from AccountSocialResponse and flattenAccountSocials; return social_id only.
    • Added test to ensure social_id is present and id is omitted.