Skip to content

feat: bulk delete endpoint for offline network clients#403

Draft
Ryanmello07 wants to merge 3 commits into
mainfrom
feature/bulk-client-delete
Draft

feat: bulk delete endpoint for offline network clients#403
Ryanmello07 wants to merge 3 commits into
mainfrom
feature/bulk-client-delete

Conversation

@Ryanmello07

@Ryanmello07 Ryanmello07 commented Jun 29, 2026

Copy link
Copy Markdown

This PR adds a bulk deletion endpoint for network clients.

Changes

  • New API route: POST /network/remove-clients
  • New handler: handlers.RemoveNetworkClients
  • New model function: model.RemoveNetworkClients
    • Accepts client_ids: []uuid
    • Runs a single atomic UPDATE network_client SET active = false WHERE client_id = ANY($1) AND network_id = $2
    • Returns early with success when client_ids is empty
    • Strictly scoped to the authenticated session's network_id to prevent cross-network deletions

Tests

  • TestRemoveNetworkClients: verifies ANY($1) driver binding and empty-input handling
  • TestRemoveNetworkClientsOnlyRemovesOwnNetwork: seeds rows in two networks and confirms only the caller's network clients are deactivated

Replays and updates the stale PR #399.

Verification

  • go build ./api/... ./model/... passes
  • WARP_ENV=local go test ./model -run TestRemoveNetworkClients -count=1 passes

full-bars added 2 commits June 4, 2026 14:38
I added a `RemoveNetworkClients` model function and a `POST /network/remove-clients` API handler to support bulk deletion. This replaces the need for the client to issue hundreds of sequential HTTP requests by processing the deletions efficiently in a single PostgreSQL `ANY()` update operation.
@Ryanmello07 Ryanmello07 force-pushed the feature/bulk-client-delete branch from e5160ed to 139fa47 Compare June 29, 2026 00:24
Adds POST /network/remove-clients and model.RemoveNetworkClients to
support deactivating multiple clients in a single atomic UPDATE scoped
by network_id. Includes tests verifying ANY() binding and network
isolation, plus a test-util locale fix for local Postgres.
@Ryanmello07 Ryanmello07 force-pushed the feature/bulk-client-delete branch from 139fa47 to 703f71f Compare June 29, 2026 00:26
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.

2 participants