Repository navigation
fix(web): cap thumbnail and analytics batches at the 50 id RPC limit - #3528
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
Author
|
hey @greptileai, please re-review the PR |
richiemcilroy
marked this pull request as ready for review
October 29, 2026 00:07
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Folders with more than 50 caps render no thumbnails, and their view counts read 0.
VideoThumbnailanduseVideosAnalyticsQueryrequest goes through a dataloader that collects everything issued in a 10 ms window into one RPC.VideosGetThumbnailsandVideosGetAnalyticsboth reject payloads over 50 ids (packages/web-domain/src/Video.ts:381). Folder pages are not paginated, so a 51-cap folder sends a 51-id batch, the client-side payload schema fails, and every request in the batch fails.{ count: 0 }.The fix sets
maxBatchSize: 50on both dataloaders (apps/web/lib/Requests/ThumbnailRequest.ts:47,apps/web/lib/Requests/AnalyticsRequest.ts:45), so a full batch flushes immediately and the next request opens a new one.flowchart LR subgraph Before A[600 cards mount] --> B[one batch, 600 ids] --> C[payload schema fails] --> D[600 failures] end subgraph After E[600 cards mount] --> F[12 batches of 50] --> G[12 RPCs] --> H[600 results] endPages with 50 or fewer cards, such as
/dashboard/caps(15 per page) and paginated space pages, still send a single batch. Their behaviour is unchanged.Before / after
51-cap folder, 3 s after load:
Numbers
Production builds of
mainand this branch on a Mac mini. Both run against the same seeded MySQL and MinIO, with injected round-trip latency (4 ms to the database, 20 ms to S3). Headless Chromium, cold load, median of 5 runs, base and head alternating./dashboard/caps, 15 cards

Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Caps thumbnail and analytics batches at 50 video IDs to match both RPC limits.
Reviews (2) · Last reviewed commit: "fix(web): cap thumbnail and analytics ba..." · Reviewed by Greptile