GRI-1962: name blocking playlists on media delete conflict #163

Merged
vivy merged 2 commits from fix/GRI-1962-media-delete-in-use-playlists into dev 2026-11-13 17:52:44 +00:00
Member

What

Deleting a PDF (or any media) that a playlist still uses failed with a generic "Could not delete that item. Try again." message that could never succeed.

Change

  • Backend (crates/server): ApiError gains an optional details field. DELETE /api/v1/media/{id} now names the referencing playlists in a 409 media_in_use's details.playlists, covering both a whole document (via its pages) and a single page/image used directly. ?remove_from_playlists=true detaches the referencing playlist items and deletes in one transaction.
  • Frontend (frontend-web): MediaScreen.tsx shows the named playlists on a 409 and offers "Remove from these playlists and delete" or cancel, instead of the old generic message. Other errors keep the generic message.

Test plan

  • cargo test -p server --test media_integration -- --include-ignored — 19 passed (covers whole-document and single-page conflict + remove-and-delete)
  • cargo test -p server --lib — 162 passed
  • clippy clean
  • npm run check (prettier, oxlint, tsc, vitest) — 35/35 tests pass
  • ./scripts/local-gates.sh — all gates passed

Closes #155

## What Deleting a PDF (or any media) that a playlist still uses failed with a generic *"Could not delete that item. Try again."* message that could never succeed. ## Change - Backend (`crates/server`): `ApiError` gains an optional `details` field. `DELETE /api/v1/media/{id}` now names the referencing playlists in a 409 `media_in_use`'s `details.playlists`, covering both a whole document (via its pages) and a single page/image used directly. `?remove_from_playlists=true` detaches the referencing playlist items and deletes in one transaction. - Frontend (`frontend-web`): `MediaScreen.tsx` shows the named playlists on a 409 and offers "Remove from these playlists and delete" or cancel, instead of the old generic message. Other errors keep the generic message. ## Test plan - `cargo test -p server --test media_integration -- --include-ignored` — 19 passed (covers whole-document and single-page conflict + remove-and-delete) - `cargo test -p server --lib` — 162 passed - clippy clean - `npm run check` (prettier, oxlint, tsc, vitest) — 35/35 tests pass - `./scripts/local-gates.sh` — all gates passed Closes https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/155
GRI-1962: name blocking playlists on media delete conflict and offer remove-and-delete
Some checks failed
CI / the pre-push hook (pull_request) Successful in 13s
CI / cargo fmt (pull_request) Successful in 16s
CI / cargo clippy (pull_request) Successful in 2m13s
CI / cargo deny advisories (pull_request) Failing after 2m3s
CI / cargo deny (pull_request) Successful in 2m6s
CI / repository boundary (pull_request) Successful in 46s
CI / frontend-web (pull_request) Successful in 1m25s
CI / cargo test (pull_request) Failing after 5m56s
CI / CI (pull_request) Failing after 32s
CI / Notify gate failed (pull_request) Successful in 25s
6aa9edc604
Media delete now answers 409 media_in_use with the playlists referencing the
document or its pages. The panel shows that list and offers removing the
item from those playlists before deleting, instead of a generic retry message.
Merge remote-tracking branch 'origin/dev' into fix/GRI-1962-media-delete-in-use-playlists
Some checks failed
CI / the pre-push hook (pull_request) Successful in 13s
CI / cargo fmt (pull_request) Successful in 12s
CI / cargo deny advisories (pull_request) Failing after 1m31s
CI / cargo deny (pull_request) Successful in 1m37s
CI / cargo clippy (pull_request) Successful in 2m14s
CI / repository boundary (pull_request) Successful in 57s
CI / frontend-web (pull_request) Successful in 1m47s
CI / cargo test (pull_request) Successful in 6m39s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 3s
d7a6c14ebd
vivy merged commit ad79695e23 into dev 2026-11-13 17:52:44 +00:00
vivy deleted branch fix/GRI-1962-media-delete-in-use-playlists 2026-11-13 17:52:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!163
No description provided.