fix: catalog-songs artistName filter must restrict rows (fixes empty valuation catalogs)#688
fix: catalog-songs artistName filter must restrict rows (fixes empty valuation catalogs)#688sweetmantech wants to merge 2 commits into
Conversation
… embed) api#681's LEFT join broke the artistName filter: a non-matching .eq on the LEFT-joined song_artists/accounts no longer drops rows, it just nulls the embed -> the query returns every catalog song with artists:[null] and a non-zero count. In chat, useArtistCatalogSongs filters by the active sidebar artist and falls back to unfiltered only when total_count===0; because the broken filter returned count>0 with [null] artists, the fallback never fired -> isCompleteSong hid every song and the row renderer crashed on null.name. When artistName is provided, inner-join song_artists/accounts so the filter restricts rows (non-matching artist -> 0 rows -> chat falls back to the full catalog). Without a filter, keep the LEFT join so artist-less captured tracks still surface (api#681). Also filter null accounts so the artists array is never [null]. Verified on preview; root-cause fix for recoupable/chat#1801. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 48 minutes and 27 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: Business logic change to database query joins based on artistName parameter. While well-motivated, it alters core data retrieval logic and could introduce regressions in song filtering.
Re-trigger cubic
Preview verification ✅Preview
So a non-matching active artist now returns 0 → the chat's existing
|
The bug (why valuation catalogs render empty)
A warm lead lands on
/catalogs/{id}; the chat'suseArtistCatalogSongsfilters by the active sidebar artist and falls back to unfiltered only when the filtered query returnstotal_count === 0.#681's LEFT join broke that filter. With
song_artists/accountsLEFT-joined, a non-matchingartistName.eqno longer drops rows — it just nulls the embed. SoGET /api/catalogs/songs?...&artistName=<active artist>on a catalog by a different artist returns every row withartists: [null]and a non-zero count. The chat's fallback never fires (count ≠ 0), so:isCompleteSongfails on the[null]artist → all songs hidden ("Found N songs", empty list)null.name→Cannot read properties of null (reading 'name')crash on "show all"This masks the now-complete data from #684 (artists) + #687 (notes).
Fix
artistNameis provided, inner-joinsong_artists/accountsso the filter restricts rows. A non-matching artist now returns0→ the chat's existing fallback refetches the full catalog → songs render with their real artists.artistName, keep the LEFT join (api#681) so artist-less tracks still surface..filter(Boolean)the accounts soartistsis never[null].Verification (preview, real DB)
Greg Mendez catalog
ccf07c48(23 complete songs):artistName=Gatsby Grace(non-matching) → before: 23 with[null]; after: 0 → chat falls back.artistName=Greg Mendez(matching) → 23 with real artists.artistName→ 23 with artists (LEFT preserved).(Preview curl results in a follow-up comment.) Root-cause fix for recoupable/chat#1801.
🤖 Generated with Claude Code
Summary by cubic
Fixes empty catalogs and a row crash in chat by making the catalog songs
artistNamefilter restrict rows.Bug Fixes
song_artistsandaccountswhenartistNameis set; keep LEFT joins when not filtering.artistsis never[null].null.namecrash while keeping artist-less tracks visible with no filter.Refactors
selectCatalogSongsWithArtistsfor consistency.Written for commit adc4018. Summary will update on new commits.