Repository navigation
feat(catalog): move filters, calendar and trailer refresh to v2 - #381
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: 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 ( |
019a408 to
9faf9fd
Compare
d162da0 to
58c61e8
Compare
9faf9fd to
2a2aa0c
Compare
The Calendar tab, the Browse facet loader and the "Find Trailers" action
still called /api/v1/calendar, /api/v1/catalog/filters and
POST /api/v1/items/{id}/trailers/refresh, although owner-fenced v2 client
methods for all three already existed and were reached only from tests.
SiloAPI now calls APIv2Client.calendar, catalogFilters and refreshTrailers
with the captured owner. Calendar weeks and facet lists are cached per
profile, so the facade refuses a result whose owner changed after the
fence released it. Facets map from APIv2CatalogFilters: technical facets
are nested under `technical` and are requested unless skipped
(`skip_technical`, the inverse of v1's `include_technical`). The trailer
refresh stays a single dispatch (the route is non_retryable and exempt
from 401 replay), and the coordinator reads a 429 from the v2 problem or
status instead of HTTPError. The v1-only CatalogFilters model is deleted
and TrailerRefreshResponse moves next to the other v2 catalog models.
Stack-PR: W5-L
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
58c61e8 to
72a03f9
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Problem
SiloAPIstill sent these requests to v1:GET /api/v1/calendarfromCalendarViewModelGET /api/v1/catalog/filtersfromFacetLoaderPOST /api/v1/items/{id}/trailers/refreshfromItemDetailViewModelthroughTrailerFetchCoordinatorAPIv2Client.calendar,catalogFiltersandrefreshTrailersalready existed with owner fences (F4 added the fence tocatalogFilters), but only tests called them. OpenAPI requiresX-Profile-Idon all three operations, and the v1 requests didn't bind the result to an owner.Solution
The Calendar tab, the Browse facet lists and the "Find Trailers" action now use
/api/v2, and the three v1 requests are gone.SiloAPI.calendarEventscaptures the owner and callsapiV2Client.calendar. The response still decodes intoCalendarResponse, which already matches the v2Calendarschema. The persistedcalendar.filtervalue goes throughCalendarFilter(rawValue:), so the client only sendsfollowing,trendingoreverything, all of which are in the v2 enum.SiloAPI.catalogFiltersreturnsAPIv2CatalogFilters. v2 inverts the technical-facets flag: technical facets are returned unless the request sendsskip_technical=true, where v1 neededinclude_technical=true.CatalogFacetsreads resolution and audio/subtitle languages from the nestedtechnicalobject, andFacetLoadercaches the v2 model. The v1-onlyCatalogFiltersmodel is deleted.ResponseCachestores calendar weeks and facet lists per profile. After the client's owner fence releases a result, the facade checks the owner again and throwsrequestIdentityChangedif it changed, as the similar-cards read in W5-K does.SiloAPI.requestTrailersRefreshcallsapiV2Client.refreshTrailers. The client accepts only202 queuedand200 cooldown|disabled.HTTPError.httpnever leaves the v2 client, soTrailerFetchCoordinatornow reads a 429 fromAPIv2Error.problemor.httpStatusto keep the rate-limit copy.TrailerRefreshResponsemoved unchanged fromModels.swifttoAPIv2CatalogModels.swift.Failure outcomes:
refreshCatalogItemTrailers(x-silo-retry-safety: non_retryable)queued, 200cooldown/disabled)queuedpolls item detail.cooldownanddisabledshow their status right away.shouldAttemptRefreshalready exempts this route from 401 replay. The coordinator ends in.requestFailed, and a 429 gets its own copy.The calendar and filters requests are reads with no mutation outcome.
Validation
CatalogActionsAPITests(new),TrailerFetchCoordinatorTests,CatalogV2Tests,ItemVideosDecodingTestsandArtworkURLTests.CatalogActionsAPITestsrun throughSiloAPIon the stubbed transport. They check:skip_technicalby default and sends it when technical facets are skipped, and that nested technical facets map intoCatalogFacetsTrailerFetchCoordinatorTestsnow drive the rate-limit and generic-failure cases with v2 errors.scripts/ci/check-no-api-v1.shpassed.Risks and follow-ups
DiagnosticsPathTemplateTestsandHTTPClientDiagnosticsClassificationTestsstill use/api/v1/catalog/filtersas a path-templating test vector. They send no request. W5-W2 and Z1 own those files.catalogFilters:cache key has no version bump. The cache lives only for the process and is cleared on profile switch, and a lookup that finds a value of another type is treated as a miss.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 33 of 50 in the Apple API v2 stack. Base:
apiv2-stack/32-similar-discover-v2. Merge in order from the bottom of the stack. The plan and full index are in PR 01.🤖 Generated with Claude Code