GRI-2104: add DELETE /devices/{id} to remove a device #251

Merged
vivy merged 3 commits from feature/GRI-2104-remove-device into dev 2026-11-15 22:03:56 +00:00
Member

Summary

  • Adds DELETE /devices/{device_id}, gated by DevicesManage, to permanently remove a device.
  • The device row deletion cascades to its device_playlist_assignments row via the existing ON DELETE CASCADE.
  • An online device is disconnected: DeviceConnections::disconnect signals the live WebSocket session via an in-process Notify, since there is no wire frame for "please hang up."
  • An unknown or out-of-campus device id 404s, matching the other device routes. A request with no session is 401.
  • If the same machine connects again after removal, it shows up as a new pending device (unaffected by removal); block remains the way to keep a device out permanently.
  • Updated plan/server/rest-api.md, which previously documented DELETE as out of MVP scope.

Test plan

No pre-written QA tests existed for this issue, so acceptance tests were written from the forge issue's "Done when" list, added in crates/server/tests/devices_integration.rs:

  • delete removes the device row and its playlist assignment
  • delete on an unknown/out-of-campus id returns 404
  • delete with no session returns 401
  • a live connection receives the disconnect signal on delete

Verified locally: ./scripts/local-gates.sh --rust-only — every gate passed.

## Summary - Adds `DELETE /devices/{device_id}`, gated by `DevicesManage`, to permanently remove a device. - The device row deletion cascades to its `device_playlist_assignments` row via the existing `ON DELETE CASCADE`. - An online device is disconnected: `DeviceConnections::disconnect` signals the live WebSocket session via an in-process `Notify`, since there is no wire frame for "please hang up." - An unknown or out-of-campus device id 404s, matching the other device routes. A request with no session is 401. - If the same machine connects again after removal, it shows up as a new pending device (unaffected by removal); `block` remains the way to keep a device out permanently. - Updated `plan/server/rest-api.md`, which previously documented DELETE as out of MVP scope. ## Test plan No pre-written QA tests existed for this issue, so acceptance tests were written from the forge issue's "Done when" list, added in `crates/server/tests/devices_integration.rs`: - [x] delete removes the device row and its playlist assignment - [x] delete on an unknown/out-of-campus id returns 404 - [x] delete with no session returns 401 - [x] a live connection receives the disconnect signal on delete Verified locally: `./scripts/local-gates.sh --rust-only` — every gate passed.
GRI-2104: add DELETE /devices/{id} to remove a device
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 8s
CI / cargo deny (pull_request) Successful in 12s
CI / cargo deny advisories (pull_request) Successful in 16s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 1m33s
CI / frontend-web (pull_request) Successful in 1m15s
CI / cargo test (pull_request) Successful in 2m59s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
5578af32eb
vivy approved these changes 2026-11-15 21:02:53 +00:00
Dismissed
vivy left a comment

Approved. DELETE removes the row, the assignment goes on the cascade, a live session ends via the per-registration Notify (fresh on each register, so a stale one cannot fire). Campus check returns 404 for a device outside the caller's scope. Tests cover delete+cascade, unknown, no session. CI green on 5578af32.

Approved. DELETE removes the row, the assignment goes on the cascade, a live session ends via the per-registration Notify (fresh on each register, so a stale one cannot fire). Campus check returns 404 for a device outside the caller's scope. Tests cover delete+cascade, unknown, no session. CI green on 5578af32.
vivy approved these changes 2026-11-15 21:24:25 +00:00
Dismissed
vivy left a comment

Correct. Delete then disconnect is the right order; a reconnect with the old token falls to handle_unknown_device (ws.rs), so the 'admitted as new pending' claim holds. DB tests run in CI (SIGNAGE_TEST_DATABASE_URL is set). Merging.

Correct. Delete then disconnect is the right order; a reconnect with the old token falls to handle_unknown_device (ws.rs), so the 'admitted as new pending' claim holds. DB tests run in CI (SIGNAGE_TEST_DATABASE_URL is set). Merging.
Merge branch 'dev' into feature/GRI-2104-remove-device
Some checks failed
CI / the pre-push hook (pull_request) Successful in 5s
CI / cargo fmt (pull_request) Successful in 6s
CI / install.sh client upgrade (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 23s
CI / cargo deny advisories (pull_request) Successful in 24s
CI / frontend-web (pull_request) Failing after 1m28s
CI / repository boundary (pull_request) Successful in 7s
CI / cargo clippy (pull_request) Successful in 2m42s
CI / cargo test (pull_request) Successful in 5m3s
CI / CI (pull_request) Failing after 3s
CI / Notify gate failed (pull_request) Successful in 2s
8c675fc866
vivy dismissed vivy's review 2026-11-15 21:24:40 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Merge branch 'dev' into feature/GRI-2104-remove-device
All checks were successful
CI / the pre-push hook (pull_request) Successful in 5s
CI / install.sh client upgrade (pull_request) Successful in 9s
CI / cargo fmt (pull_request) Successful in 5s
CI / cargo deny (pull_request) Successful in 18s
CI / cargo deny advisories (pull_request) Successful in 23s
CI / repository boundary (pull_request) Successful in 7s
CI / cargo clippy (pull_request) Successful in 2m0s
CI / frontend-web (pull_request) Successful in 1m28s
CI / cargo test (pull_request) Successful in 5m20s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 3s
d8d1e3d02f
vivy merged commit 88bee3b275 into dev 2026-11-15 22:03:56 +00:00
vivy deleted branch feature/GRI-2104-remove-device 2026-11-15 22:03:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!251
No description provided.