perf(fleet): scope /admin/fleet reads to registry tenant slugs - #72
Conversation
…#71 follow-up) Filter fleetDevice/fleetSummary findMany by the registry's active tenant slugs so orphaned/decommissioned rows aren't loaded as the fleet grows. No-op at the current single-tenant scale; the deferred optimization from the #71 release review. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
There was a problem hiding this comment.
Code Review
This pull request scopes the database queries for fleet devices and summaries to only the active tenant slugs, preventing orphaned or decommissioned rows from being loaded. The reviewer suggested an optimization to skip these database queries entirely if the list of tenant slugs is empty, avoiding unnecessary database roundtrips.
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.



Summary
Deferred Gemini review finding from the #71 release:
/admin/fleetfetched allFleetDevice/FleetSummaryrows. Now scoped to the registry's active tenant slugs (where: { tenantSlug: { in: tenantSlugs } }), so orphaned/decommissioned rows aren't loaded as the fleet grows.No-op at the current single-tenant scale (and orphaned rows were already never rendered — the page only maps over
registry.tenants), so it's a scale-ahead tidy, not a correctness fix.Checklist
tsc --noEmitcleanrequireAdmin()unchanged (first line)🤖 Generated with Claude Code