Skip to content

fix: handle duplicate room creation race condition (#157) - #162

Merged
sidneyswift merged 1 commit into
mainfrom
test
Jan 27, 2026
Merged

fix: handle duplicate room creation race condition (#157)#162
sidneyswift merged 1 commit into
mainfrom
test

Conversation

@sidneyswift

@sidneyswiftsidneyswift commented Jan 27, 2026

Copy link
Copy Markdown
Contributor
  • fix: use upsert instead of insert for rooms

One-line fix: change insert to upsert in insertRoom.ts. Removes try/catch workarounds since upsert handles duplicates.

Summary by CodeRabbit

  • Bug Fixes
    • Room records can now be properly updated if they already exist, improving reliability when creating or modifying room data.

✏️ Tip: You can customize this high-level summary in your review settings.

* fix: use upsert instead of insert for rooms
One-line fix: change insert to upsert in insertRoom.ts.
Removes try/catch workarounds since upsert handles duplicates.
@vercel

vercelBot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentReviewUpdated (UTC)
recoup-apiReadyReadyPreviewJan 27, 2026 2:43pm

@sidneyswift
sidneyswift merged commit 65de8a0 into mainJan 27, 2026
5 of 6 checks passed
@coderabbitai

coderabbitaiBot commented Jan 27, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The insertion function in the room creation module is modified from executing a standard INSERT operation to an UPSERT operation, enabling the database to update existing records instead of creating only new ones. The return type, error handling, and column selection logic remain unchanged.

Changes

Cohort / File(s)Summary
Room Database Operation
lib/supabase/rooms/insertRoom.ts
Changed database operation from INSERT to UPSERT, allowing room records to be updated if they already exist

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A room that was inserted now can also take a turn,
From INSERT into UPSERT, a lesson we all learn!
If it exists, update it; if not, create anew,
One simple swap of syntax makes the magic true! ✨

✨ Finishing touches
  • 📝 Generate docstrings

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

github-actionsBot commented Jan 27, 2026

Copy link
Copy Markdown

Braintrust eval report

Catalog Opportunity Analysis Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
Catalog_availability26.8% (+5pp)4 🟢1 🔴
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration38.12s (-6.27s)3 🟢2 🔴

Catalog Songs Count Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
AnswerCorrectness19.3% (+0pp)3 🟢-
Factuality66.7% (+33pp)1 🟢-
Llm_calls4 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Completion_accepted_prediction_tokens0tok (+0tok)--
Completion_rejected_prediction_tokens0tok (+0tok)--
Completion_audio_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration12.01s (-1.91s)3 🟢-

First Week Album Sales Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
Factuality40% (-20pp)1 🟢1 🔴
Llm_calls1 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Completion_accepted_prediction_tokens0tok (+0tok)--
Completion_rejected_prediction_tokens0tok (+0tok)--
Completion_audio_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration13.86s (-0.42s)2 🟢2 🔴

Memory & Storage Tools Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
Tools_called0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration16.41s (+0.03s)-1 🔴

Monthly Listeners Tracking Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
AnswerSimilarity77.4% (-3pp)2 🟢3 🔴
Llm_calls2 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration15.03s (+2.17s)2 🟢3 🔴

Search Web Tool Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
AnswerCorrectness26.4% (-2pp)4 🟢7 🔴
Llm_calls3 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Completion_accepted_prediction_tokens0tok (+0tok)--
Completion_rejected_prediction_tokens0tok (+0tok)--
Completion_audio_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration28s (+0.14s)4 🟢7 🔴

Social Scraping Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
Tools_called0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration20.92s (-5.64s)4 🟢2 🔴

Spotify Followers Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
AnswerCorrectness20.5% (0pp)1 🟢4 🔴
Llm_calls3 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Completion_accepted_prediction_tokens0tok (+0tok)--
Completion_rejected_prediction_tokens0tok (+0tok)--
Completion_audio_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration14.78s (+1.61s)3 🟢2 🔴

Spotify Tools Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
Tools_called0% (+0pp)--
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration30.3s (-3.98s)1 🟢1 🔴

TikTok Analytics Questions Evaluation (HEAD-1769525071)

ScoreAverageImprovementsRegressions
Question_answered0% (-10pp)-1 🔴
Llm_calls0 (+0)--
Tool_calls0 (+0)--
Errors0 (+0)--
Llm_errors0 (+0)--
Tool_errors0 (+0)--
Prompt_tokens0tok (+0tok)--
Prompt_cached_tokens0tok (+0tok)--
Prompt_cache_creation_tokens0tok (+0tok)--
Completion_tokens0tok (+0tok)--
Completion_reasoning_tokens0tok (+0tok)--
Total_tokens0tok (+0tok)--
Duration16.54s (-0.76s)1 🟢1 🔴

sidneyswift added a commit that referenced this pull request Jan 27, 2026
sidneyswift added a commit that referenced this pull request Jan 27, 2026
@coderabbitaicoderabbitaiBot mentioned this pull request Jan 27, 2026
Merged
Sign up for freeto 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

@sidneyswift