Opening a source list was much slower than the API behind it. Listings downloaded every track and playlist cover one at a time, each over a new TLS connection, before returning anything. A 30-result search took 11–16 s and a NetEase playlist page about a minute; the same API answers in about 1 s with curl.
Changes
Listings now return as soon as the source answers. cover_url becomes a host artwork key; the webview loads visible covers in parallel through a new source-art protocol that serves the on-disk cache or downloads with load_resource under the source's resource origins. Descriptor headers stay in the host. CSP allows the scheme for images only.
Source requests and resource downloads share one pooled HTTP client, so repeated calls to the same service reuse their connection. Its DNS resolver refuses any name that resolves to a non-public address (previously enforced by resolving per request).
Contracts updated in catalog.md and source-host.md.
Measurements
Release build, macOS, same network and accounts, time from click to the list rendering:
Action
Before
After
NetEase playlists (cold source)
~60 s
2.6 s
NetEase liked songs (3,000+)
~90 s
2.2 s
NetEase search
11–16 s
1.9 s
Bilibili favorites folder (371 items)
>40 s
1.7 s
Bilibili search
—
1.9 s
QQ Music search
~10 s
1.5 s
For reference, one request with curl: 0.4–1.4 s. A fresh reqwest client costs ~0.7 s per request against ~0.15 s on a reused connection.
Bilibili search in the release build after the change (covers load in after the list):
Test plan
cargo test --release --lib -- source_host catalog: all pass; redirect_set_cookies_are_redacted_before_the_body_is_logged fails only when run together with other tests because of the global logger, also on main, and passes alone
cargo clippy --release --lib --tests: clean
New tests: artwork keys depend only on source, URL and headers; image type sniffing; the shared resolver refuses localhost; an unreachable cover fails at load time, not in the listing
pnpm exec vp test run for StreamingCover
Release app with real NetEase, Bilibili and QQ Music accounts (timings above)
Security profile: covers still only load from the source's declared resource origins over public HTTPS; the webview never sees descriptor headers
Reviewing files that changed from the base of the PR and between c5343ea641816113602b6986f09b1655e78b6556 and 95f057f785c14ebd38c2885d9879cc8dab7600c5.
Files selected for processing: 13
docs/references/contracts/catalog.md
docs/references/contracts/source-host.md
src-tauri/src/catalog/artwork.rs
src-tauri/src/catalog/mod.rs
src-tauri/src/catalog/plugin.rs
src-tauri/src/catalog/plugin_tests.rs
src-tauri/src/commands/catalog.rs
src-tauri/src/lib.rs
src-tauri/src/source_host/network.rs
src-tauri/tauri.conf.json
src/components/Catalog/StreamingCover.test.tsx
src/components/Catalog/StreamingCover.tsx
src/types/ipc.ts
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 88.0%. Comparing base (c5343ea) to head (95f057f).
:white_check_mark: All tests successful. No failed tests found.
This review did not finish. The model reached its output limit before it
could write the review — a reasoning model can spend the whole budget thinking.
Re-run the review, or lower the model's thinking effort, and it should get
further. Any inline comments below are from an earlier review.