Skip to content

feat: Optimized Device connections and DB-level selector filtering#1412

Draft
davidebriani wants to merge 1 commit intoedgehog-device-manager:mainfrom
davidebriani:feat/feat-device-read-action-by-group-selector
Draft

feat: Optimized Device connections and DB-level selector filtering#1412
davidebriani wants to merge 1 commit intoedgehog-device-manager:mainfrom
davidebriani:feat/feat-device-read-action-by-group-selector

Conversation

@davidebriani
Copy link
Copy Markdown
Collaborator

Summary

  • Transforms device group selector resolution into a scalable database-level filter via the Device read action.
  • Deprecates the unpaginated in-memory ManualRelationship list to prevent BEAM OOM crashes on large groups.
  • Modifies the React frontend to fetch devices as a root GraphQL Connection matching the group ID, enabling native Relay cursor pagination.
  • Re-writes Channel calculations (updatable_devices, deployable_devices, download_capable_devices) to push large OR expressions down to PostgreSQL.

This prepares the backend for swapping NimbleParsec to CEL in the next phase without performance regressions.

Migrations

No database schema changes required in this step. Frontend gracefully degrades by switching to DevicesTable.

@davidebriani davidebriani force-pushed the feat/feat-device-read-action-by-group-selector branch 10 times, most recently from 057cfa6 to b92ace8 Compare May 5, 2026 13:02
Replaces the unpaginated manual relationship `devices` in `DeviceGroup`
with a scalable root `devices` connection that translates the group selector
into a native Ash.Expr database filter.

Updates Channel calculations (updatable_devices, deployable_devices,
download_capable_devices) to execute Postgres-level filters instead
of loading devices into memory, resolving OOM risks on huge groups.

Updates the frontend `DeviceGroup` component to query the root connection
and consume the standard `DevicesTable` component.

Signed-off-by: Davide Briani <davide.briani@secomind.com>
@davidebriani davidebriani force-pushed the feat/feat-device-read-action-by-group-selector branch from b92ace8 to 72bc8bb Compare May 5, 2026 13:14
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