feat(printers): remove printers and devices as archives, purged by retention #26

Merged
james.maes merged 1 commits from feat/remove-printers-devices-20261105 into feat/printer-approval-20261105 2026-11-05 22:22:24 +00:00
Owner

Stacks on PR #25 (feat/printer-approval-20261105); review only the top commit.

What

Archive, not delete: nullable removed_at on printing_printer and printing_device (read-only Removed at on both tables, idempotent ADD COLUMN IF NOT EXISTS).

  • Remove printers (printingRemoveSelectedPrinters, printer record + multi-select, review step) and PrintingService.removePrinter(deviceId, printerId): sets removed_at, enabled=0, available=0; excluded from printersPage/printers, operator catalog, submissions, claims, device/printer selectors and the PRINTERS frame (pushed again on removal). enablePrinter on a removed printer returns 409. A re-shared queue returns exposed, not approved (logged).
  • Remove device (printingRemoveDevices, confirmation required): reuses the REVOKE control action, then PrintingService.removeDevice(deviceId) archives the device and its printers; an already revoked device is archived without a new command. Hidden from devices(), selectors, requireDevice. Cannot be restored.
  • Retention cleanup purges removed printers no job references (by printer_row_id or device+queue) and removed devices with no jobs and no printers, bounded by the batch size, logged.
  • Native inventory authorization also covers removed rows so a re-shared queue reactivates.

Deviation: QQQ has no table-level default filter, so the Printers / Print devices views document the Removed at is empty filter instead.

Validation

.\mvnw.cmd -Pui-demo verify: 199 tests run, 0 failures, 0 errors, 1 skipped (opt-in workload), 0 Checkstyle violations, BUILD SUCCESS. check-source-headers.py: 147 files verified.

🤖 Generated with Claude Code

Stacks on PR #25 (`feat/printer-approval-20261105`); review only the top commit. ## What Archive, not delete: nullable `removed_at` on `printing_printer` and `printing_device` (read-only **Removed at** on both tables, idempotent `ADD COLUMN IF NOT EXISTS`). - **Remove printers** (`printingRemoveSelectedPrinters`, printer record + multi-select, review step) and `PrintingService.removePrinter(deviceId, printerId)`: sets `removed_at`, `enabled=0`, `available=0`; excluded from `printersPage`/`printers`, operator catalog, submissions, claims, device/printer selectors and the `PRINTERS` frame (pushed again on removal). `enablePrinter` on a removed printer returns 409. A re-shared queue returns exposed, not approved (logged). - **Remove device** (`printingRemoveDevices`, confirmation required): reuses the REVOKE control action, then `PrintingService.removeDevice(deviceId)` archives the device and its printers; an already revoked device is archived without a new command. Hidden from `devices()`, selectors, `requireDevice`. Cannot be restored. - Retention cleanup purges removed printers no job references (by `printer_row_id` or device+queue) and removed devices with no jobs and no printers, bounded by the batch size, logged. - Native inventory authorization also covers removed rows so a re-shared queue reactivates. Deviation: QQQ has no table-level default filter, so the Printers / Print devices views document the **Removed at is empty** filter instead. ## Validation `.\mvnw.cmd -Pui-demo verify`: 199 tests run, 0 failures, 0 errors, 1 skipped (opt-in workload), 0 Checkstyle violations, BUILD SUCCESS. `check-source-headers.py`: 147 files verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
james.maes added 1 commit 2026-11-05 22:11:56 +00:00
feat(printers): remove printers and devices as archives, purged by retention
QRun-IO/ci-policy: ci / fork-guard (pull_request) Skipped
QRun-IO/ci-policy: native / fork-deny (pull_request) Skipped
QRun-IO/ci-policy: native / dotnet-0 (pull_request) Skipped
Shared Java Maven CI / verify (push) Failing after 1s
Shared Java Maven CI / secrets (push) Failing after 1s
QRun-IO/ci-policy: ci / Scoped workflow [workflow 1b3648d9421543350067e95e54959dfb471b26d5] (pull_request) Failing after 3s
QRun-IO/ci-policy: native / native-result (pull_request) Failing after 1s
QRun-IO/ci-policy: ci / head-profile (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy (pull_request) Skipped
QRun-IO/ci-policy: ci / application-template-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / gradle-1 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-core-2-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-3-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-docker-4 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-frontend-browser-5 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-6-head (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7 (pull_request) Skipped
QRun-IO/ci-policy: ci / java-maven-7-head (pull_request) Skipped
QRun-IO/ci-policy: ci / node-8 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-9 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-10 (pull_request) Skipped
QRun-IO/ci-policy: ci / node-playwright-11 (pull_request) Skipped
QRun-IO/ci-policy: ci / repository-policy-12 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-13 (pull_request) Skipped
QRun-IO/ci-policy: ci / source-config-14 (pull_request) Skipped
QRun-IO/ci-policy: ci / android-0 (pull_request) Skipped
QRun-IO/ci-policy: ci / original-business (pull_request) Skipped
QRun-IO/ci-policy: ci / original-mcp (pull_request) Skipped
QRun-IO/ci-policy: ci / original-voyage (pull_request) Skipped
QRun-IO/ci-policy: ci / original-cli (pull_request) Skipped
QRun-IO/ci-policy: ci / not-enrolled (pull_request) Skipped
QRun-IO/ci-policy: ci / shared-pipeline (pull_request) Skipped
Shared Java Maven CI / gate (push) Failing after 3s
qrun-release / release (push) Failing after 2m7s
qrun-release / postpublish (push) Skipped
QRun-IO/ci-policy: ci / ci-result (pull_request) Failing after 2s
c5a9c6d37f
Add nullable removed_at to printing_printer and printing_device (read-only
"Removed at" on both tables) through the existing idempotent migration.

Remove printers (printingRemoveSelectedPrinters, record and selection) and
PrintingService.removePrinter set removed_at, clear approval and exposure,
and drop the printer from the operator catalog, submissions, claims, the
device/printer selectors and the PRINTERS frame, which is pushed again. A
removed queue that the device shares again returns exposed but not
approved; approval changes on a removed printer are refused.

Remove device (printingRemoveDevices, confirmation required) revokes access
through the existing REVOKE control, then PrintingService.removeDevice
archives the device and all of its printers; an already revoked device is
archived without a new command. Removed devices leave the device list,
every device selector and all authenticated paths; job history stays.

Retention cleanup hard-deletes removed printers that no job references and
removed devices with no jobs and no printers, bounded by the batch size and
logged. Native inventory authorization still covers removed rows so a
re-shared queue can reactivate.

Tests cover hiding, re-sharing, device removal with history, purge bounds
and process metadata. Docs: README, UI walkthrough, storage and retention,
realtime, changelog (1.1.0).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
james.maes merged commit a1ca7201e7 into feat/printer-approval-20261105 2026-11-05 22:22:24 +00:00
Sign in to join this conversation.