Repository navigation
refactor(api): share one APIv2Client from SiloAPI - #350
Conversation
|
Warning Review limit reachedNext included review available in 12 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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 |
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.
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. |
Code review summaryReviewed head: Process: an adversarial review of this PR's diff with each candidate finding independently verified before any fix, a simplify pass for medium and larger PRs, and a whole-stack review across contract conformance, authority and failure handling, data integrity, user-visible behavior and cross-PR integration. Verified findings: none. Validation: this branch builds on its own for iOS, tvOS and macOS, and its focused tests passed. The completed stack passed the full iOS suite (1981 tests) and tvOS suite (1792 tests) with 0 failures, the macOS build and the v1 path guard. The final stack was also exercised on iOS and tvOS simulators against a v1/v2 bridge server: sign-in (password and QR), restore, browse, search, detail, favorites and watchlist, playback (direct play, transcode, subtitles, stop), audiobooks, downloads with offline playback, settings, requests, profiles, push registration and diagnostics. Server logs showed no Remaining: no open verified findings. Merge in stack order. Mergeability: 8/10 — conditional. The approach holds up and every verified finding is fixed. Conditions: this PR's CI must pass (it was pending at review time), and the owner still plans a physical-device check of the completed stack. Review by Claude Opus 5.5 ( |
590c404 to
e60b329
Compare
055dcd0 to
21dff02
Compare
SiloAPI built a fresh APIv2Client inline for each of its four v2 detail reads, and code outside the actor had no shared client to call. Later v2 migrations would have kept adding more inline constructions. Store one apiV2Client on SiloAPI, built from the same injected HTTPClient and TokenStore, and route the four reads through it. The property is a nonisolated let so non-actor callers can use SiloAPI.shared.apiV2Client without an actor hop. No behavior change. Stack-PR: F1 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
21dff02 to
93cff73
Compare
Problem
SiloAPIbuilt a newAPIv2Client(http:tokenStore:)inline for each of its four v2 detail reads (itemDetail,seasons,episodes,watchDetail). Code outside the actor had no shared v2 client to use, so each upcoming v2 migration would add more inline constructions.Solution
apiV2ClientonSiloAPI, built ininitfrom the same injectedHTTPClientandTokenStore. It uses the same name as open PR feat(player): support all marker occurrences #343.nonisolated let(APIv2Clientis aSendablestruct), so callers outside the actor can useSiloAPI.shared.apiV2Clientdirectly.Behavior does not change. The client is a stateless value over the same transport and token store, and its
isUpdateRequiredcheck still runs on each call. This PR owns no inventory rows.Validation
All runs used the stack build helper on this branch:
build ios,build tvos,build macos: PASS.test ios SiloTests/LibraryDetailScopeTests SiloTests/ArtworkURLTests: PASS, 18 tests.LibraryDetailScopeTestssends the facade's detail reads through aStubURLProtocol-backedHTTPClient, which confirms the shared client uses the injected transport.test tvos SiloTVTests/LibraryDetailScopeTests SiloTVTests/ArtworkURLTests: PASS, 18 tests.No new test was added. The change moves code without changing behavior, and the existing facade tests already cover it.
Risks and follow-ups
SiloAPI.swift. Whichever PR lands second gets a trivial conflict: keep one declaration.SiloAPI.shared.apiV2Client(or the injected facade'sapiV2Client) instead of buildingAPIv2Clientat call sites.AI disclosure
Code and description written by Claude Opus 5.5 (
claude-opus-5-5) agents in Claude Code (T3 Code), orchestrated by a Claude Code workflow.Part 2 of 50 in the Apple API v2 stack. Base:
apiv2-stack/01-pin-contract-fixtures. Merge in order from the bottom of the stack. The plan and full index are in PR 01.🤖 Generated with Claude Code