fix(manager): optimize coverage query and add regression tests#639
Closed
fix(manager): optimize coverage query and add regression tests#639
Conversation
Strapi v5 GraphQL defaults nested relation limits to 10 items.
The videos query nested children/variants/subtitles without explicit
pagination, silently truncating coverage data for translated videos.
- Flatten query: replace nested children with parents field, reconstruct
hierarchy in application code to eliminate N+1 resolution (~4s to ~1.5s)
- Add pagination: { limit: -1 } on all nested relations to return all items
- Extract shared SWR cache utility with TTL, max-stale, promise dedup
- Add stale-while-revalidate to videos route (was blocking on every miss)
- Refactor languages route to use shared SWR cache utility
- Add cache warming via Next.js instrumentation hook for Railway deploys
- Trim unused source/coreId fields from variants/subtitles in query
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ution
Captures the discovery that Strapi v5 GraphQL defaults nested relation
limits to 10 items (silently truncating data), and the fix pattern of
using pagination: { limit: -1 } with flat queries and shared SWR cache.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
# Conflicts: # apps/manager/src/app/api/videos/route.ts # apps/manager/src/instrumentation.ts # apps/manager/src/lib/swr-cache.ts
|
🚅 Deployed to the forge-pr-639 environment in forge
1 service not affected by this PR
|
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.
Summary
@forge/managertest command and update lockfile metadata for the new test toolingTesting