From a6064eccb2087934dc8dd2eb38205fe30ed6da09 Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 8 Jul 2026 21:24:50 +0200 Subject: [PATCH] fix(spa): playlist tree tolerates a single group's fetch failure (#153 review) Use Promise.allSettled when loading each group's playlists so one group's transient error shows that group empty rather than blanking the whole tree. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/screens/PlaylistsScreen.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/screens/PlaylistsScreen.tsx b/web/src/screens/PlaylistsScreen.tsx index 84ec9b6ed..a67844e25 100644 --- a/web/src/screens/PlaylistsScreen.tsx +++ b/web/src/screens/PlaylistsScreen.tsx @@ -804,10 +804,13 @@ function usePlaylistTreeData() { const load = useCallback(() => { getPlaylistGroups() .then(async (groups) => { - const lists = await Promise.all(groups.map((group) => getPlaylists(group.id))); + // allSettled so one group's transient fetch failure shows that group empty + // rather than blanking the whole tree. + const lists = await Promise.allSettled(groups.map((group) => getPlaylists(group.id))); const playlists: Record = {}; groups.forEach((group, index) => { - playlists[group.id] = lists[index]; + const result = lists[index]; + playlists[group.id] = result.status === 'fulfilled' ? result.value : []; }); return { groups, playlists }; })