From 3c5bccf1b685b909504026588216c5f8937741d2 Mon Sep 17 00:00:00 2001 From: KeelrLeek <156356974+KeelrLeek@users.noreply.github.com> Date: Sat, 1 Aug 2026 07:11:25 -0500 Subject: [PATCH] recents: a streamed album has no library id, so the key must not pretend it does The sidebar history looked completely dead -- albums never appeared, the list never updated, and often nothing was there at all. The backend was fine the whole time: 460 play rows, recent_albums returning every album correctly. The list is a keyed each on `a:${album_id}`, but catalog-anchored rows -- every streamed play -- carry album_id NULL by design and are identified by catalog_album_id. One streamed album in history keyed `a:null` harmlessly. The second one collided with it, the keyed each threw, and the whole list unmounted; every later refresh fed a dead component. It demoed clean yesterday only because history had just been wiped and exactly one streamed album existed. Keys now carry the id realm, the same two-realm split isPlaying and openRecent already used. --- src/components/Sidebar.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Sidebar.svelte b/src/components/Sidebar.svelte index 312bead..e55a213 100644 --- a/src/components/Sidebar.svelte +++ b/src/components/Sidebar.svelte @@ -82,7 +82,15 @@ day = k; rows.push({ kind: "day", label: k, key: `d:${k}` }); } - rows.push({ kind: "album", album: a, key: `a:${a.album_id}` }); + // Two id realms, so the key must carry the realm: catalog rows + // have album_id NULL, and keying them all `a:null` was a + // duplicate-key crash that silently killed this whole list the + // moment TWO streamed albums entered history (2026-08-01). + rows.push({ + kind: "album", + album: a, + key: a.kind === "catalog" ? `c:${a.catalog_album_id}` : `l:${a.album_id}`, + }); } return rows; });