fix(images): resolve artwork against its supplying server - #308
Conversation
There was a problem hiding this comment.
Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change resolves server-relative artwork URLs against their response origin, adds tests for phone and TV image loading, and starts session-scoped image capability discovery in phone and TV applications. ChangesArtwork URL resolution and capability discovery
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant SiloAPI
participant safeApiV2Call
participant ArtworkURLResolver
participant ImageConsumer
SiloAPI->>safeApiV2Call: Return JSON with artwork paths
safeApiV2Call->>ArtworkURLResolver: Resolve paths against response origin
ArtworkURLResolver-->>safeApiV2Call: Return transformed JSON
safeApiV2Call-->>ImageConsumer: Decode model with resolved artwork URLs
Merge Risk: ⚪ Minimal · up to The artwork URL and session-capability changes preserve server association across switches without retaining stale capability data. No actionable merge risk was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
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. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The PR correctly targets server-specific artwork resolution and adds strong regression coverage, but it also changes shared API response decoding and introduces an automatically launched authenticated capability probe in both applications. Those cross-cutting runtime changes warrant human review. You can add or adjust custom eligibility rules. Learn more. |
Local artwork responses can contain signed root-relative URLs. Android passed those values to Coil and media-session consumers without a server origin, so local-storage posters and backdrops could fail to load.
Resolve artwork fields in shared API response decoding, using the origin of the request that supplied the response. The resolved URLs retain their encoded paths and signature queries, ignore configured base paths, and remain tied to their supplying server after a switch. Absolute S3 URLs pass through unchanged. This covers phone and TV image components, direct prefetch requests, Cast artwork, and media-session artwork before those values enter caches or UI state.
Probe
GET /api/v2/images/capabilitiesat startup and active-session changes, with captured authentication scope and cancellation of obsolete probes. Optionalstorage_backendanddeliveryfields tolerate older and future responses. Artwork resolution works independently of probe success or timing.Closes #306. Related: Silo-Server/silo-server#935.
Validation:
Limitations: physical phone/TV rendering against live local-storage and S3-backed Silo servers remains unverified. The integration fixtures exercise local and direct delivery but are not a live S3 service. Future artwork wire fields must be added to the shared field list.
AI disclosure: implemented with OpenAI
gpt-6-astrain the Codex agent harness through T3 Code. No other AI tooling or sub-agents were used.Note
Resolve API V2 artwork URLs against their supplying server origin
safeApiV2Callbefore model decoding, preserving signed path and query encoding; absolute, protocol-relative, file, content, and empty values are left unchanged.ImageCapabilitiesApiandImageCapabilitiesSessionwired through the shared DI graph, with both phone and TV apps starting the session coordinator in a background IO scope on startup.ImageCapabilitiesSessionprobes the V2 image capabilities endpoint on startup and after identity changes, clears state during transitions, and only publishes a result if the probed identity still matches.Authorization, profile, orCookieheaders across phone and TV configurations.resolveArtworkUrlin ArtworkUrls.kt discards the server URL base path — any deployment serving API artwork under a sub-path will now produce origin-rooted URLs instead of preserving that base path.Macroscope summarized 3921492.
Summary by CodeRabbit