Skip to content

fix(manager): optimize coverage query and add regression tests#639

Closed
lumberman wants to merge 4 commits intomainfrom
fix/optimize-videos-graphql-query
Closed

fix(manager): optimize coverage query and add regression tests#639
lumberman wants to merge 4 commits intomainfrom
fix/optimize-videos-graphql-query

Conversation

@lumberman
Copy link
Copy Markdown
Collaborator

Summary

  • flatten the manager coverage video query and extract collection-building logic into a tested helper
  • keep the SWR cache behavior aligned with main while adding focused cache and hierarchy regression tests
  • add a real @forge/manager test command and update lockfile metadata for the new test tooling

Testing

  • pnpm --filter @forge/manager test
  • pnpm --filter @forge/manager typecheck

lumberman and others added 4 commits March 28, 2026 13:41
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
@railway-app
Copy link
Copy Markdown

railway-app bot commented Apr 2, 2026

🚅 Deployed to the forge-pr-639 environment in forge

Service Status Web Updated (UTC)
@forge/manager 🕗 Deploying (View Logs) Apr 2, 2026 at 2:33 am
@forge/cms ✅ Success (View Logs) Apr 2, 2026 at 2:33 am
1 service not affected by this PR
  • @forge/web

@railway-app railway-app bot temporarily deployed to forge / forge-pr-639 April 2, 2026 02:29 Destroyed
@lumberman lumberman closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant