signage#115: playlist content edits never push to an already-assigned device #129

Closed
opened 2026-11-11 06:50:12 +00:00 by astraea · 1 comment
Member

What happened

Smoke test (#115) run8, dev tip 91e72c4 (with #127/#128's server-side media transfer landed): enroll, approve, upload, assign, and initial playback all now work end to end for the first time. The test then edits the already-assigned playlist's items (PUT /api/v1/playlists/{id}/items) and waits for the real client to pick up the change. It never does — the client keeps looping the original two-item playlist forever (confirmed: 30s+ of continuous playback: item ... Video(...) / Image(...) log lines for the old items, no new MediaManifest/PlaylistPush ever arrives).

Root cause

plan/shared/protocol.md:104 is explicit:

PlaylistPush: Server → client, sent once on assignment and again on every change to the device's assigned playlist.

and crates/server/src/playlists/handlers.rs:331 (doc comment on push_to_device) says the same: "on every playlist change a fresh MediaManifest, PlaylistPush and TransferOffer...".

But replace_items (crates/server/src/playlists/handlers.rs:236), the only handler wired to PUT /playlists/{playlist_id}/items (crates/server/src/playlists/mod.rs:32-33), never calls push_to_device or any push at all — it only writes the new items via store::replace_items and returns the detail view. The only two places that push to a live connection are assign_playlist (on a fresh assignment) and push_current_assignment (on an Accepted reconnect). Editing the content of a playlist that is already assigned to a connected device pushes nothing, so the device never finds out until its next reconnect (or never, for a device that stays connected).

Repro

  1. Assign a playlist (image + video) to a connected, Accepted device.
  2. Confirm playback starts (works).
  3. PUT /api/v1/playlists/{playlist_id}/items with a different item set, same playlist id.
  4. Observe: the client's log keeps showing only the original items; no new PlaylistPush frame is ever sent.

Logs and the live repro stack are on the build host in /home/astraea/repos/wt-GRI-1885 (compose project server, client log under /tmp/mvp-smoke-test.oCVzze/client.log), left up for inspection. Full smoke-test log: /tmp/mvp-smoke-test-GRI-1885-run8.log.

Fix

replace_items needs to look up which device(s), if any, are currently assigned the edited playlist and call the same push (MediaManifest + PlaylistPush + TransferOffers) that assign_playlist sends — per spec, on every change to the assigned playlist, not just on (re)assignment.

This is a backend/protocol fix, outside Test Writer scope — not mine to make.

## What happened Smoke test ([#115](https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/115)) run8, dev tip `91e72c4` (with #127/#128's server-side media transfer landed): enroll, approve, upload, assign, and initial playback all now work end to end for the first time. The test then edits the already-assigned playlist's items (`PUT /api/v1/playlists/{id}/items`) and waits for the real client to pick up the change. It never does — the client keeps looping the original two-item playlist forever (confirmed: 30s+ of continuous `playback: item ... Video(...)` / `Image(...)` log lines for the *old* items, no new `MediaManifest`/`PlaylistPush` ever arrives). ## Root cause `plan/shared/protocol.md:104` is explicit: > `PlaylistPush`: Server → client, sent **once on assignment and again on every change to the device's assigned playlist**. and `crates/server/src/playlists/handlers.rs:331` (doc comment on `push_to_device`) says the same: "on every playlist change a fresh `MediaManifest`, `PlaylistPush` and `TransferOffer`...". But `replace_items` (`crates/server/src/playlists/handlers.rs:236`), the only handler wired to `PUT /playlists/{playlist_id}/items` (`crates/server/src/playlists/mod.rs:32-33`), never calls `push_to_device` or any push at all — it only writes the new items via `store::replace_items` and returns the detail view. The only two places that push to a live connection are `assign_playlist` (on a fresh assignment) and `push_current_assignment` (on an `Accepted` reconnect). Editing the *content* of a playlist that is already assigned to a connected device pushes nothing, so the device never finds out until its next reconnect (or never, for a device that stays connected). ## Repro 1. Assign a playlist (image + video) to a connected, Accepted device. 2. Confirm playback starts (works). 3. `PUT /api/v1/playlists/{playlist_id}/items` with a different item set, same playlist id. 4. Observe: the client's log keeps showing only the original items; no new `PlaylistPush` frame is ever sent. Logs and the live repro stack are on the build host in `/home/astraea/repos/wt-GRI-1885` (compose project `server`, client log under `/tmp/mvp-smoke-test.oCVzze/client.log`), left up for inspection. Full smoke-test log: `/tmp/mvp-smoke-test-GRI-1885-run8.log`. ## Fix `replace_items` needs to look up which device(s), if any, are currently assigned the edited playlist and call the same push (`MediaManifest` + `PlaylistPush` + `TransferOffer`s) that `assign_playlist` sends — per spec, on every change to the assigned playlist, not just on (re)assignment. This is a backend/protocol fix, outside Test Writer scope — not mine to make.
vivy closed this issue 2026-11-11 07:37:56 +00:00
Owner

Fixed by #130, merged into dev at eb0de5b. Astraea: rerun the smoke test on dev tip.

Fixed by #130, merged into dev at eb0de5b. Astraea: rerun the smoke test on dev tip.
Sign in to join this conversation.
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#129
No description provided.