Skip to content

fix: strip www. prefix in normalizeProfileUrl to fix Instagram social linking#151

Merged
sweetmantech merged 1 commit intotestfrom
sweetmantech/myc-4006-goosebytheway-missing-instagram
Jan 22, 2026
Merged

fix: strip www. prefix in normalizeProfileUrl to fix Instagram social linking#151
sweetmantech merged 1 commit intotestfrom
sweetmantech/myc-4006-goosebytheway-missing-instagram

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

Summary

  • Fixed bug where Instagram socials weren't being added when URLs contained www. prefix
  • Updated normalizeProfileUrl to strip www. prefix for consistent URL matching
  • Added tests for www. prefix handling in both normalizeProfileUrl.test.ts and updateArtistSocials.test.ts

Root Cause

When the AI passes URLs like https://www.instagram.com/goosebytheway/, the normalized URL becomes www.instagram.com/goosebytheway. If the database already has the social stored as instagram.com/goosebytheway (without www.), the lookup fails and the social fails to be linked.

Test plan

  • Added failing test that proves the bug exists (RED)
  • Fixed normalizeProfileUrl to strip www. prefix (GREEN)
  • All existing tests still pass
  • Added unit tests for www. prefix stripping in normalizeProfileUrl.test.ts

🤖 Generated with Claude Code

… linking

When URLs with www. prefix (e.g., www.instagram.com/user) were passed to
updateArtistSocials, they wouldn't match existing socials in the database
that were stored without the www. prefix. This caused Instagram socials
to not be added when the AI provided URLs with www. prefix.

The fix normalizes all URLs by stripping the www. prefix, ensuring
consistent URL matching regardless of input format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

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
Copy Markdown

github-actions bot commented Jan 22, 2026

Braintrust eval report

Catalog Opportunity Analysis Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
Catalog_availability 2.8% (+3pp) 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 49.05s (-19.11s) 3 🟢 2 🔴

Catalog Songs Count Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
AnswerCorrectness 19% (0pp) 1 🟢 2 🔴
Factuality 100% (+100pp) 3 🟢 -
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 14.58s (+0.68s) 1 🟢 2 🔴

First Week Album Sales Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
Factuality 55% (-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 14.5s (-1.56s) 3 🟢 1 🔴

Memory & Storage Tools Evaluation (HEAD-1769103938)

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 13.93s (-5.2s) 1 🟢 -

Monthly Listeners Tracking Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
AnswerSimilarity 76.8% (0pp) 2 🟢 3 🔴
Llm_calls 2 (+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 13.24s (-5.49s) 3 🟢 2 🔴

Search Web Tool Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
AnswerCorrectness 25.4% (+1pp) 8 🟢 3 🔴
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 25.74s (+1.18s) 4 🟢 7 🔴

Social Scraping Evaluation (HEAD-1769103938)

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 20.98s (-4.12s) 3 🟢 3 🔴

Spotify Followers Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
AnswerCorrectness 20.9% (+0pp) 4 🟢 1 🔴
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 15.95s (+1.54s) 1 🟢 4 🔴

Spotify Tools Evaluation (HEAD-1769103938)

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 36.32s (+6.19s) - 2 🔴

TikTok Analytics Questions Evaluation (HEAD-1769103938)

Score Average Improvements Regressions
Question_answered 10% (+10pp) 1 🟢 -
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 18.18s (+0.47s) 1 🟢 1 🔴

@vercel
Copy link
Copy Markdown
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 Building Building Preview Jan 22, 2026 5:45pm

@sweetmantech sweetmantech merged commit 144ed9d into test Jan 22, 2026
4 of 5 checks passed
@sweetmantech sweetmantech deleted the sweetmantech/myc-4006-goosebytheway-missing-instagram branch January 22, 2026 17:47
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