perf(calendar): serve hot releases from a single endpoint#2893
Conversation
Replaces the client-side hot releases assembly (a releases-calendar fetch plus separate trending and anticipated fetches per media type, then an in-browser intersect) with one request to the new `/calendars/releases/hot` endpoint, which does the gating and merge server-side and returns the feed already ordered by availability date. The mapper now just discriminates the union response, coalesces episodes and sorts. Drops the now-dead `sourceLimit` param from both callers and the `HideRecommended` invalidations. Bumps @trakt/api to 0.4.22 for the new contract.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request optimizes the calendar releases feature by transitioning from a multi-request client-side assembly process to a single, server-side aggregated endpoint. By offloading the filtering and merging logic to the worker, the client-side code is simplified, and the overall performance is improved by reducing the number of API calls required to populate the releases calendar. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene Coverage |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Jul 13, 2026 6:52p.m. | Review ↗ | |
| Code coverage | Jul 13, 2026 6:52p.m. | Review ↗ |
Code Coverage Summary
| Language | Line Coverage (Overall) |
|---|---|
| Aggregate | 65.3% [▼ down 0.1% from main] |
| Javascript | 65.3% [▼ down 0.1% from main] |
➟ Additional coverage metrics may have been reported. See full coverage report ↗
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Code Review
This pull request refactors the releases calendar query by replacing multiple API requests (upcoming movies/episodes and trending/recommended/anticipated lists) with a single call to the hot releases endpoint (/calendars/releases/hot). This simplifies the logic significantly, removing several unused helper functions, types, and the sourceLimit parameters across the calendar features. Feedback suggests adding a defensive guard on response.body in the query mapper to handle nullish or empty API responses gracefully and prevent potential runtime errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@gemini-code-assist Reviewed the one suggestion:
No code changes needed. |
|
Understood, thanks for the clarification. That makes sense—if |
What
Replaces the client-side "hot releases" assembly with one request to the new
/calendars/releases/hotendpoint.Before: a releases-calendar fetch plus separate trending and anticipated fetches per media type (5-6 requests), then an in-browser intersect to keep only releases that are also trending/anticipated.
After: one request. The worker does the gating and merge server-side and returns the feed already ordered by availability date. The mapper just discriminates the union response, coalesces episodes, and sorts.
Changes
releasesCalendarQuery.ts: singleapi().calendars.releasesHot(...)call + discriminated mapper. Drops theHideRecommendedinvalidations (no recommendations in the mix anymore).useReleasesItems.ts/useReleasesCalendar.ts: dropped the now-deadsourceLimit.@trakt/apibumped to 0.4.22 for the new contract.Dependency chain
@trakt/api@0.4.22)Verification
svelte-check: 0 errors (7114 files)test:unitreleasesCalendarQuery spec: passeseslint: cleanNote on filters
The merged endpoint applies one filter set to both movies and shows (matching the worker's
filters()middleware), so per-typefilterOverrideis no longer honored here; the globalfilteris used. The releases surface only uses the global filter.