From dadaa7a8c4aef2c067f350a67f81714f63718dec Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Thu, 18 Jun 2026 15:46:00 -0500 Subject: [PATCH 1/2] fix: LEFT-join artists in catalog-songs read so materialized tracks surface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit selectCatalogSongsWithArtists used song_artists!inner -> accounts!inner, so valuation-captured tracks (which have songs + song_measurements but no song_artists yet) were filtered out — a materialized catalog read back as 0 songs (verified live on api#677). Drop the two !inner so artist-less songs return with artists: []; songs!inner stays (catalog_songs.song FK guarantees it). Closes the read-path half of the song_artists follow-up in recoupable/chat#1801. Longer-term (option a): the capture pipeline should also write song_artists. --- .../catalog_songs/selectCatalogSongsWithArtists.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts b/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts index 8639eb405..857c71ddc 100644 --- a/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts +++ b/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts @@ -44,6 +44,10 @@ export async function selectCatalogSongsWithArtists( ): Promise { const { catalogId, isrcs, artistName, page, limit } = params; + // `song_artists`/`accounts` are LEFT-joined (no `!inner`): valuation-captured + // tracks have `songs` + `song_measurements` but no `song_artists` yet, and an + // inner join would hide every materialized catalog song. `songs!inner` stays — + // the catalog_songs.song FK guarantees the song row. let query = supabase .from("catalog_songs") .select( @@ -55,9 +59,9 @@ export async function selectCatalogSongsWithArtists( album, notes, updated_at, - song_artists!inner ( + song_artists ( artist, - accounts!inner ( + accounts ( id, name, timestamp From c2bb97badf18db0038c08c4f0453b4cb7a396327 Mon Sep 17 00:00:00 2001 From: "sweetman.eth" Date: Thu, 18 Jun 2026 16:36:18 -0500 Subject: [PATCH 2/2] Update lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts --- lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts b/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts index 857c71ddc..47cc14206 100644 --- a/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts +++ b/lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts @@ -44,10 +44,6 @@ export async function selectCatalogSongsWithArtists( ): Promise { const { catalogId, isrcs, artistName, page, limit } = params; - // `song_artists`/`accounts` are LEFT-joined (no `!inner`): valuation-captured - // tracks have `songs` + `song_measurements` but no `song_artists` yet, and an - // inner join would hide every materialized catalog song. `songs!inner` stays — - // the catalog_songs.song FK guarantees the song row. let query = supabase .from("catalog_songs") .select(