Skip to content

MCP - update_artist_socials#53

Merged
sweetmantech merged 2 commits into
testfrom
sweetmantech/myc-3737-mcp-update_artist_socials
Dec 13, 2025
Merged

MCP - update_artist_socials#53
sweetmantech merged 2 commits into
testfrom
sweetmantech/myc-3737-mcp-update_artist_socials

Conversation

@sweetmantech

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

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

Project Deployment Review Updated (UTC)
recoup-api Ready Ready Preview Dec 13, 2025 7:17pm

@coderabbitai

coderabbitai Bot commented Dec 13, 2025

Copy link
Copy Markdown

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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-3737-mcp-update_artist_socials

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.

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

The return type annotation declares Promise<Tables<"socials">[] | null> but the implementation always returns an array (never null), creating a type inconsistency that could mislead callers.

View Details
📝 Patch Details
diff --git a/lib/supabase/socials/selectSocials.ts b/lib/supabase/socials/selectSocials.ts
index ee04075..efa001a 100644
--- a/lib/supabase/socials/selectSocials.ts
+++ b/lib/supabase/socials/selectSocials.ts
@@ -15,7 +15,7 @@ type SelectSocialsParams = {
  */
 export async function selectSocials(
   params: SelectSocialsParams,
-): Promise<Tables<"socials">[] | null> {
+): Promise<Tables<"socials">[]> {
   let query = supabase.from("socials").select("*").order("updated_at", { ascending: false });
 
   if (params.id) {

Analysis

Type annotation mismatch in selectSocials() - function always returns array, never null

What fails: selectSocials() in lib/supabase/socials/selectSocials.ts declares return type Promise<Tables<"socials">[] | null> but the implementation always returns an array, never null.

How to reproduce:

// The type contract says the function might return null:
const result: Promise<Tables<"socials">[] | null> = selectSocials({ ... });

// But looking at the implementation:
return data || [];  // Always returns an array, never null

Result: TypeScript type checker allows code to assume the function might return null. However, Supabase's select() method returns { data: [], error: null } (not { data: null, error: null }) when there are no matching results. After the error check, data is never null, so data || [] always returns an array.

Expected: According to Supabase documentation, the select query returns an empty array when no rows match, not null. Therefore, the return type should be Promise<Tables<"socials">[]>, not Promise<Tables<"socials">[] | null>.

Impact: The misleading type annotation causes callers to defensively check for null (e.g., socials?.[0] in lib/socials/postSocialScrapeHandler.ts), which is unnecessary defensive programming and obscures the actual contract.

Comment thread lib/artist/updateArtistSocials.ts
@sweetmantech sweetmantech merged commit 01a1962 into test Dec 13, 2025
3 checks passed
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