Repository navigation
feat(lists): page favorites and watchlist from v2 - #385
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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, all fixed on this branch:
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 ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dc91f4587
ℹ️ 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".
| var items = result.value.items | ||
| for pageNumber in 1...100 { | ||
| guard let continuation = result.continuation else { | ||
| return CatalogResponse(items: items, total: items.count, totalExact: true, hasMore: false) |
There was a problem hiding this comment.
Recheck list ownership before returning it
When the active profile changes after the final personalListPage finishes its withOwnerFence check but while that page is being decoded or assembled, result.continuation can be nil and this returns the previous profile's items without consulting auth again. loadFavorites and loadWatchlist then cache that response under process-wide keys, so a late completion after the profile-switch cache clear can repopulate the cache and expose profile A's saved titles to profile B. Revalidate the captured owner immediately before publishing the complete response, including after the last page.
Useful? React with 👍 / 👎.
9dc91f4 to
8af5c19
Compare
8335d86 to
9d378b3
Compare
The Favorites and Watchlist screens read GET /api/v1/favorites and /api/v1/watchlist once with offset 0 and limit 100, so anything past the 100th saved title never appeared. SiloAPI.favorites() and watchlist() now read the whole list from /api/v2/favorites and /api/v2/watchlist with the existing cursor client, 200 items a page, every page under the first page's owner. The read is bounded at 100 pages and throws incompletePersonalList past that instead of showing a cut-off list as complete. The v1 methods are deleted. Stack-PR: W5-N Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Favorites and watchlist were its last callers; they now pass imageSizeQuery["image_size"] to personalListItems like every other v2 call site. Stack-PR: W5-N Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
8af5c19 to
0c0a415
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Problem
The Favorites and Watchlist screens (iOS, tvOS, macOS) loaded their list with one
GET /api/v1/favoritesorGET /api/v1/watchlistcall atoffset=0&limit=100. Any saved title after the 100th never appeared. Both calls were also among the last v1 personal-data reads.Solution
SiloAPI.favorites()andSiloAPI.watchlist()now read the whole list fromGET /api/v2/favoritesandGET /api/v2/watchlist(listFavorites/listWatchlist). They use the existingAPIv2Client.personalList/nextPersonalListPagecursor client with 200 items per page and the image-size preference.APIv2Client+PersonalLists.swiftpages untilhas_moreis false. Every page sends the first page'sX-Profile-Idand goes through the existing owner fence. A profile switch mid-read throws instead of returning the old profile's list.APIv2Error.incompletePersonalListrather than showing a truncated list as complete. A repeated or missing cursor still throwsinvalidPersonalListContinuation.offset: 0, limit: 100call. They still filter by media type locally and cache the result under the sameResponseCachekeys.SiloAPI.favorites(offset:limit:)andSiloAPI.watchlist(offset:limit:)(rows 60, 61), and thewithImageSizehelper they were the last callers of.This uses the standalone routes, which the Apple client already had. Android reads these lists through
/api/v2/catalog?source=favorites|watchlist, which also returns a total and supports sorting. Apple needs neither, because its screens load the full list and filter it locally.Validation
PersonalListsAPITestson iOS and tvOS, andCatalogPagingAPITestson iOS.PersonalListsAPITestsuseAPIv2TestStub. They cover:limit=200, nooffset, andX-Profile-Idon every requestscripts/ci/check-no-api-v1.shpassed.Risks and follow-ups
invalid_cursormid-read (for example after an access-policy change) surfaces as an error. It does not restart from page 1 the way catalog grids do. The keyset cursor survives adds and removes, so this should be rare.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 37 of 50 in the Apple API v2 stack. Base:
apiv2-stack/36-people-v2. Merge in order from the bottom of the stack. The plan and full index are in PR 01.🤖 Generated with Claude Code