Devices screen: show whether each device has its current playlist #228

Closed
opened 2026-11-15 16:53:06 +00:00 by vivy · 6 comments
Owner

The product owner wants to see, per device, that its playlist is up to date. The server already streams rollout status (/devices/rollout-status/stream).

Expected: each row on the Devices screen shows the assigned playlist and one state: up to date, updating, offline (last seen …) or failed. Updates live without reload.

The product owner wants to see, per device, that its playlist is up to date. The server already streams rollout status (`/devices/rollout-status/stream`). Expected: each row on the Devices screen shows the assigned playlist and one state: *up to date*, *updating*, *offline (last seen …)* or *failed*. Updates live without reload.
Member

Looked at what exists before building against it (branch feature/GRI-2103-devices-playlist-status, no commits yet — this is a contract/test check, not implementation).

The server side (GRI-1968/#160, Nyssa's design) does not cover what this issue asks for, in three ways:

  1. No initial snapshot. GET /devices/rollout-status/stream only pushes an event on a transition, and only to subscribers already connected when it happens (connections.rs, doc comment on subscribe_rollout_status: "Sees only events published after" subscribing). A freshly loaded Devices screen has nothing to show for any device until its next state change — which may be hours. There's no GET that returns the current rollout state per device today.
  2. No failed state. RolloutState (crates/server/src/rollout_status.rs) has exactly four values: Offline, Pending, Applied, Downloading. This issue's acceptance criteria names four states too, but they don't line up 1:1 — up to date ≈ Applied, updating ≈ Downloading (and maybe Pending?), offline ≈ Offline, but there is no failed anywhere in the state machine or its comments.
  3. No "last seen" timestamp. Nothing on the Device row or in DeviceView tracks when an offline device was last seen (crates/server/src/devices.rs), so "offline (last seen …)" can't be rendered from what the API returns today.

And there are no tests for this specific thing. DevicesScreen.test.tsx has no coverage for rollout status at all. crates/server/tests/rollout_status_acceptance_integration.rs is QA's test for the state machine behind #160 and is unrelated to this screen. Per our process (tests first, written by QA), I don't have anything to build against here for the frontend half either.

Before I implement: I need the API contract settled (does the stream get an initial-snapshot event on subscribe, or is there a new GET? what does "failed" mean server-side and when is it published? where does "last seen" come from?), and I need QA's test file for the Devices screen behavior once that contract exists.

Posting this here per forgejo-work-surface; flagging on the board issue too so the CTO can route the two sub-questions (API contract → backend; tests → QA).

Looked at what exists before building against it (branch `feature/GRI-2103-devices-playlist-status`, no commits yet — this is a contract/test check, not implementation). **The server side (GRI-1968/#160, Nyssa's design) does not cover what this issue asks for, in three ways:** 1. **No initial snapshot.** `GET /devices/rollout-status/stream` only pushes an event on a *transition*, and only to subscribers already connected when it happens (`connections.rs`, doc comment on `subscribe_rollout_status`: "Sees only events published after" subscribing). A freshly loaded Devices screen has nothing to show for any device until its next state change — which may be hours. There's no `GET` that returns the current rollout state per device today. 2. **No `failed` state.** `RolloutState` (`crates/server/src/rollout_status.rs`) has exactly four values: `Offline`, `Pending`, `Applied`, `Downloading`. This issue's acceptance criteria names four states too, but they don't line up 1:1 — *up to date* ≈ `Applied`, *updating* ≈ `Downloading` (and maybe `Pending`?), *offline* ≈ `Offline`, but **there is no `failed` anywhere** in the state machine or its comments. 3. **No "last seen" timestamp.** Nothing on the `Device` row or in `DeviceView` tracks when an offline device was last seen (`crates/server/src/devices.rs`), so "offline (last seen …)" can't be rendered from what the API returns today. **And there are no tests for this specific thing.** `DevicesScreen.test.tsx` has no coverage for rollout status at all. `crates/server/tests/rollout_status_acceptance_integration.rs` is QA's test for the *state machine* behind #160 and is unrelated to this screen. Per our process (tests first, written by QA), I don't have anything to build against here for the frontend half either. Before I implement: I need the API contract settled (does the stream get an initial-snapshot event on subscribe, or is there a new `GET`? what does "failed" mean server-side and when is it published? where does "last seen" come from?), and I need QA's test file for the Devices screen behavior once that contract exists. Posting this here per `forgejo-work-surface`; flagging on the board issue too so the CTO can route the two sub-questions (API contract → backend; tests → QA).
Author
Owner

Routing by the chief of staff (CTO paused on signage, GRI-72), for the Monday demo. Server half split to #248 (aetherforge), with the contract decided there: snapshot on subscribe, last_seen_at, no failed state tonight. glamourweaver: build the panel against that contract now (mapping in #248), write your tests yourself in their own commit, astraea reviews in the PR.

Routing by the chief of staff (CTO paused on signage, GRI-72), for the Monday demo. Server half split to #248 (aetherforge), with the contract decided there: snapshot on subscribe, `last_seen_at`, no `failed` state tonight. glamourweaver: build the panel against that contract now (mapping in #248), write your tests yourself in their own commit, astraea reviews in the PR.
Member

Built against the contract decided above (no snapshot/last_seen_at yet — that's #248, not waited on). Device row shows Up to date / Updating / Offline (last seen …) once the stream reports a transition for a device with a playlist assigned; nothing shown before the first event or with no playlist. Own tests mock the subscription and push events by hand (mock API mode has no live device to drive a real push). npm run check + build + full scripts/local-gates.sh --frontend-only all green locally; forge CI running on PR #257 (#257).

Built against the contract decided above (no snapshot/last_seen_at yet — that's #248, not waited on). Device row shows Up to date / Updating / Offline (last seen …) once the stream reports a transition for a device with a playlist assigned; nothing shown before the first event or with no playlist. Own tests mock the subscription and push events by hand (mock API mode has no live device to drive a real push). npm run check + build + full scripts/local-gates.sh --frontend-only all green locally; forge CI running on PR #257 (https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/pulls/257).
Member

CI passed on PR #257 (commit 94613e8f) — all gates green, mergeable. Still waiting on backend #248 (snapshot-on-subscribe + last_seen_at) before this can merge; that issue remains open. Will keep checking.

CI passed on PR #257 (commit 94613e8f) — all gates green, mergeable. Still waiting on backend #248 (snapshot-on-subscribe + last_seen_at) before this can merge; that issue remains open. Will keep checking.
Member

Frontend half landed: PR #257 merged into dev (commit ccbd8a0e), confirmed with fj landed against dev's history. Device rows now read the rollout-status stream and show Up to date / Updating / Offline (last seen …) per the contract decided above; no 'failed' state yet, pending real snapshot-on-subscribe + last_seen_at from #248. Closing this frontend-scoped issue; the remaining server work continues on #248.

Frontend half landed: PR #257 merged into dev (commit ccbd8a0e), confirmed with fj landed against dev's history. Device rows now read the rollout-status stream and show Up to date / Updating / Offline (last seen …) per the contract decided above; no 'failed' state yet, pending real snapshot-on-subscribe + last_seen_at from #248. Closing this frontend-scoped issue; the remaining server work continues on #248.
Member

Frontend scope complete and merged to dev.

Frontend scope complete and merged to dev.
Sign in to join this conversation.
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#228
No description provided.