fix(library): fetch full library via paginated apps query - #541
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
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: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_7f300983-67dd-46ea-9856-f9c118f70182) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7acab460d3
ℹ️ 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".
| ): Promise<GameInfo[]> { | ||
| const vpcId = await getVpcId(token, providerStreamingBaseUrl); | ||
| try { | ||
| const apps = await fetchPaginatedLibraryApps(token, vpcId); |
There was a problem hiding this comment.
Bump the library cache key for paginated results
For users who already have a games:library cache written by the previous panel-based fetch, fetchLibraryGames returns that cached array before this new paginated path is ever reached, and the cache key/version is unchanged. Because loadFromCache returns cached data even when it is expired, the old 40-game library can continue to be shown after upgrade until a manual/forced refresh rewrites it; bump or invalidate the library cache when switching to the paginated result format.
Useful? React with 👍 / 👎.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…aming#541) * Fetch entire owned library via paginated GraphQL query Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Bump library cache for paginated fetch results Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This PR adds cursor-based pagination to the library fetch to resolve the 40-game limit reported in #532.
paginatedApps.tswithfetchAllAppsPageshelper to traversehasNextPagecursors.fetchPaginatedLibraryAppsusing the officialappsquery filtered bylibrary.status != "NOT_OWNED".isInLibraryandlastPlayedflags during metadata enrichment.Note
Medium Risk
Changes core library loading and GraphQL behavior; fallback limits user impact, but very large libraries could still fail at the 25-page cap.
Overview
Fixes the ~40-game library cap by loading the user library through the GFN
appsGraphQL query with cursor pagination instead of relying only on the LIBRARY panel.A new
fetchAllAppsPageshelper walkshasNextPage/endCursor(200 items per page, up to 25 pages) and throws if the page limit is hit so results are not silently truncated. Library fetch filters to owned titles (library.status != NOT_OWNED) and uses the existing last-played sort order.fetchLibraryGamesUncachedtries this path first, then falls back to the panel query on failure.mergeAppMetaIntoGamenow keeps library flags (isInLibrary,lastPlayed, per-variant library fields) when metadata enrichment overwrites app data.Reviewed by Cursor Bugbot for commit 7acab46. Configure here.