Skip to content

perf(fleet): scope /admin/fleet reads to registry tenant slugs - #72

Merged
mahmutkaya merged 1 commit into
developfrom
feature/fleet-panel-filter-by-registry
Jul 20, 2026
Merged

mahmutkaya merged 1 commit into
developfrom
feature/fleet-panel-filter-by-registry

Conversation

@mahmutkaya

Copy link
Copy Markdown
Contributor

Summary

Deferred Gemini review finding from the #71 release: /admin/fleet fetched all FleetDevice/FleetSummary rows. 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 --noEmit clean
  • Read-only, no schema change, no i18n change
  • requireAdmin() unchanged (first line)

🤖 Generated with Claude Code

…#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>
@sonarqubecloud

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/(control)/admin/fleet/page.tsx
@mahmutkaya
mahmutkaya merged commit 84621bb into develop Jul 20, 2026
16 checks passed
@mahmutkaya
mahmutkaya deleted the feature/fleet-panel-filter-by-registry branch July 20, 2026 12:43
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