Repository navigation
Persist artwork in a bounded global disk cache - #260
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31685a4dba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| px = img::img_decode_rgba(b.as_ptr(), b.len() as c_int, &mut w, &mut h); | ||
| // Only a successfully decoded response may replace an existing image. | ||
| if !px.is_null() { | ||
| if let Some(k) = &disk { crate::imgcache::write_at(cache_gen, k, &b); } |
There was a problem hiding this comment.
Revalidate the profile grant after fetching artwork
If a profile switch occurs while fetch_built_outcome is in flight, this writes bytes authorized by the old profile because only the account cache generation is checked after the request; token_gen was checked only before network I/O. Since disk keys intentionally omit the token and the cache survives profile switches, the newly active profile can later read artwork it may not be authorized to access. Recheck that the client pointer and token_gen are still current after the fetch and before caching or publishing; the refresh worker has the same check-before-fetch race in refresh.rs.
Useful? React with 👍 / 👎.
Revisiting artwork after RAM eviction or restarting the app currently downloads it again. Add a shared disk tier for posters, backdrops, logos, episode stills, avatars and headshots, bounded to 128 MiB / 8,192 files, with atomic writes, stable server/transform keys, stale-while-revalidate refresh and sign-out generation fencing.
Keep main’s scrolling deferral, transient retries and bounded GPU-residency recovery. Bound decoded-upload backlog and share immutable Library key snapshots instead of copying a large catalog on every frame. Add frame-interval/drop counters and a reproducible 1,200-image fixture.
Validation:
See
docs/image-cache.mdanddocs/measurements/global-image-cache-2026-09-26.mdfor policy and measured frame-drop results. Some renderer stalls remain; this does not claim locked 60 FPS.