/* Five reads that never depended on one another. Each is a spawn_blocking SQLite read behind the library's single `conn: Mutex`, so the queries still take their turn — what is saved is five bridge round trips collapsing into one. Every call keeps the handling it had. The one thing that could have moved is `lib.error`, which has two writers and used to be settled by the order they were awaited in; the two messages are carried out of the round and applied in that same order instead, so a failing library still shows the library's message and not app_status's, no matter which of them answers last. Nothing is dropped, nothing new is asked for, and `lib.loaded` still goes up only once all five have settled. */ const [statusErr, albumsErr, , follows, playlists] = await Promise.all([ api.appStatus().then((st) => { lib.version = st?.version ?? ""; lib.username = st?.connected_as ?? null; return null; }, (e) => String(e)), api.libraryAlbums().then((rows) => { lib.albums = rows; return null; }, (e) => String(e)), refreshRecents(), // writes lib.recents itself, and swallows its own failure api.followedArtists().then((rows) => rows || [], () => []), api.listPlaylists().then((rows) => rows || [], () => []), ]); if (statusErr) lib.error = statusErr; if (albumsErr) lib.error = albumsErr; lib.follows = follows; lib.playlists = playlists; lib.loaded = true; void refreshStats();