Skip to content

fix: prevent Spotify social deletion when updating multiple platforms#150

Merged
sweetmantech merged 1 commit intotestfrom
sweetmantech/myc-3999-deleted-socials-goosebytheway
Jan 22, 2026
Merged

fix: prevent Spotify social deletion when updating multiple platforms#150
sweetmantech merged 1 commit intotestfrom
sweetmantech/myc-3999-deleted-socials-goosebytheway

Conversation

@sweetmantech
Copy link
Contributor

Summary

  • Fix bug where Spotify socials get deleted when adding YouTube via update_artist_socials
  • Root cause: stale accountSocials array caused the insert check to incorrectly skip re-inserting the Spotify relationship after deletion

Bug Details

When AI calls update_artist_socials with both YouTube AND existing Spotify URLs:

  1. The existing Spotify account_social is deleted
  2. The code checks if account_social relationship exists using stale accountSocials array
  3. Stale array still contains the deleted record → insert is skipped
  4. Result: Spotify social is deleted but never re-linked

Fix

Always insert the account_social relationship after processing a platform, since we know we deleted the old one (if it existed).

Test plan

  • Added failing test that reproduces the bug (RED)
  • Applied fix and verified test passes (GREEN)
  • All existing tests still pass

🤖 Generated with Claude Code

Bug: When AI calls update_artist_socials with both YouTube AND existing
Spotify URLs, the Spotify social gets deleted but NOT re-inserted.

Root cause: The accountSocials array is fetched once at the start of
updateArtistSocials and becomes stale after deleting a social. The
check on lines 52-54 used this stale array to determine if the
account_social relationship exists, incorrectly skipping the insert.

Fix: Always insert the account_social relationship after processing
a platform, since we know we deleted the old one (if it existed).

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
recoup-api Ready Ready Preview Jan 22, 2026 4:36pm

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

Braintrust eval report

Catalog Opportunity Analysis Evaluation (HEAD-1769099743)

Score Average Improvements Regressions
Catalog_availability 0% (-22pp) - 2 🔴
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 68.16s (+22.61s) 4 🟢 1 🔴

Catalog Songs Count Evaluation (HEAD-1769099743)

Score Average Improvements Regressions
AnswerCorrectness 19.3% (0pp) 2 🟢 1 🔴
Factuality 0% (-67pp) - 2 🔴
Llm_calls 4 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 13.89s (-1s) 3 🟢 -

First Week Album Sales Evaluation (HEAD-1769099743)

Score Average Improvements Regressions
Factuality 75% (+20pp) 1 🟢 1 🔴
Llm_calls 1 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 16.06s (+2.83s) - 4 🔴

Memory & Storage Tools Evaluation (HEAD-1769099743)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 19.13s (+2.77s) - 1 🔴

Monthly Listeners Tracking Evaluation (HEAD-1769099743)

Score Average Improvements Regressions
AnswerSimilarity 76.9% - -
Llm_calls 2 - -
Tool_calls 0 - -
Errors 0 - -
Llm_errors 0 - -
Tool_errors 0 - -
Prompt_tokens 0tok - -
Prompt_cached_tokens 0tok - -
Prompt_cache_creation_tokens 0tok - -
Completion_tokens 0tok - -
Completion_reasoning_tokens 0tok - -
Total_tokens 0tok - -
Duration 18.73s - -

Search Web Tool Evaluation (HEAD-1769099743)

Score Average Improvements Regressions
AnswerCorrectness 24.2% (-2pp) 2 🟢 9 🔴
Llm_calls 3 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 24.56s (-2.76s) 9 🟢 2 🔴

Social Scraping Evaluation (HEAD-1769099742)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 25.1s (+1.58s) 2 🟢 4 🔴

Spotify Followers Evaluation (HEAD-1769099742)

Score Average Improvements Regressions
AnswerCorrectness 20.7% (0pp) 1 🟢 4 🔴
Llm_calls 3 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 14.41s (-0.95s) 3 🟢 2 🔴

Spotify Tools Evaluation (HEAD-1769099742)

Score Average Improvements Regressions
Tools_called 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 30.13s (-4.71s) 2 🟢 -

TikTok Analytics Questions Evaluation (HEAD-1769099742)

Score Average Improvements Regressions
Question_answered 0% (+0pp) - -
Llm_calls 0 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 0tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 0tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 0tok (+0tok) - -
Duration 17.71s (+0.16s) 1 🟢 1 🔴

@sweetmantech sweetmantech merged commit 2ff8a20 into test Jan 22, 2026
5 checks passed
@sweetmantech sweetmantech deleted the sweetmantech/myc-3999-deleted-socials-goosebytheway branch January 22, 2026 16:58
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