Live rollout view: which devices have the latest playlist #160
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#160
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
After Save on a playlist, the operator wants to see per device whether the new version is applied, downloading (with progress) or offline/not yet reached — live, without reloading.
Done when
Field feedback from the product owner on GRI-1960; wanted before the one-campus production test.
Released to nyssa as her second item, after #157 (or while waiting on astraea's tests). Server side first: per-device 'has playlist revision N' from the existing online state (#58).
Design proposal, before writing any code.
What I found in the current code
Playlist/Itemhave no version number, onlyplaylists.updated_atanddevice_playlist_assignments.assigned_at.ClientHello/ServerHello) does not need to change, and I don't think the rest of the protocol does either (see below).Heartbeatalready carriesplaying_item, sent every 30s, andconnections.rsalready knows which devices are live right now.WebSocket/EventSourceanywhere infrontend-web. This issue is the product's first server→panel push channel.Proposed design — no wire-protocol version bump
Compute rollout status server-side only, from data the server already has, instead of adding a new client→server message:
DeviceConnectionsfor the device.Heartbeat.playing_itemis one of the current assignment'sPlaylist::item_ids().Item::idis already "replaced on content change" (seecontent-model.md), so this naturally flips to not-applied the moment a device is pushed a new version, with no revision counter needed.ws.rs::stream_transfer); it just isn't tracked anywhere per-device yet.playing_itemnot yet in the new item set (the push landed, the device hasn't heartbeated since, or has nothing new to download and hasn't switched over yet).Changes this needs:
connections.rs::Connectiongainslast_playing_item: Option<ItemId>andtransfer_progress: Option<{transfer_id, bytes_done, bytes_total}>, set fromws.rson eachHeartbeatand on each chunk sent instream_transfer(currentlyhandle_client_textsilently dropsHeartbeat— that's the hook point).rollout_status(device_id)read that joins that withplaylists::store::current_assignment+item_ids().tokio::sync::broadcast) thatconnections.rspublishes to whenever a device's computed status changes (not on every heartbeat — only on a transition), and a newGET /api/v1/devices/rollout-status/streamSSE endpoint the panel subscribes to. SSE over a secondWebSocket: one-directional, browser-nativeEventSource, no new frozen contract on the browser side.Two things I'd like decided before I write code
rollout,download_state,applied_revision,DownloadState,1968across every branch). Same situation as #157 — I'd like astraea on the tests against the design above, in parallel, the way GRI-1961 was unblocked.feature/GRI-1964-campus-ownership(unmerged, campus-ownership — identity/access, his half per our split): it's currently touchingdevices.rs(+60),playlists/handlers.rs(+68),playlists/store.rs(+29) andws.rs(+3) — exactly the filesrollout_statusneeds to read from and the filews.rsneeds the newHeartbeathook in. I'd rather not land conflicting edits there. Should I wait for GRI-1964 to merge, or is there a narrow slice we can coordinate now?Also: the SSE event shape is an interface Prismancer's panel code will consume — want to confirm the payload shape with her before I build it, same as any API shape she has to write against.
Not starting implementation until these are resolved.
Re-checked at ~20:00Z: one of the two blockers is resolved — GRI-1964 (campus ownership, #162) merged into
dev, so the file conflict ondevices.rs/playlists/handlers.rs/playlists/store.rs/ws.rsis gone.Still outstanding, unchanged since my design comment: (1) no QA-authored tests exist yet for this issue — asked for astraea on tests in parallel, same pattern as #157/GRI-1961, no response yet; (2) no sign-off from Prismancer on the SSE payload shape. Not starting implementation without tests per the usual rule. #157/GRI-1961 (my primary item) is also still waiting on astraea's tests, unchanged since 19:50Z.
Flagging to vivy: both of my active items are now blocked on the same missing resource (astraea's test-writing capacity). If that's a priority call, let me know; otherwise I'll keep re-checking.
astraea: please write the acceptance tests for this issue now, against nyssa's design comment above, on a test/ branch (pattern of #174/#177). nyssa: #172 tests are merged (#177); #162 conflict is gone. Chief of staff.
nyssa: astraea's fail-first tests for this issue are in
dev(#184,crates/server/tests/rollout_status_acceptance_integration.rs). They carry#[ignore], so CI does not run them yet. Your implementation PR must remove every#[ignore]in that file, so CI really runs them against its Postgres; I will not merge it while any remain (same rule as #180 and #181). Chief of staff.nyssa: the acceptance tests for this issue are in dev (PR #184, tests/rollout_status_acceptance_integration.rs, 9 tests marked #[ignore]). Please implement now, remove the #[ignore] marks in the same PR, and open the PR to dev. Chief of staff.
Landed in dev via PR #188 (9 acceptance tests un-ignored, CI green). Closed.