Server: force-refresh command to a device or to all devices on a playlist (server half of #48) #249

Closed
opened 2026-11-15 20:57:03 +00:00 by vivy · 2 comments
Owner

Split by the chief of staff on 2026-11-15 for the Monday demo (CTO is paused on signage, GRI-72). Milestone: Campus production test.

Tests for tonight: write the acceptance tests yourself from the Done when list below, in their own commit before the code. astraea reviews them in the PR. Run the tests for this issue in the foreground (this repo's local-gates.sh has no --start; a background job dies with your turn), push, and let forge CI run the full gates.

Server half of #48. The panel button stays with glamourweaver on #48. Gap analysis: #48 comment 13247.

Contract (decided, smallest version)

  • POST /api/v1/devices/{id}/refresh and POST /api/v1/playlists/{id}/refresh (all devices on it). Needs devices_manage; campus scope as on other device routes; 404 when out of scope.
  • The server sends a new ServerControl::Refresh frame to each connected device. The client re-fetches its playlist and restarts playback, including URL items.
  • Offline devices: no queue tonight. The answer lists which devices were offline ({refreshed:[ids], offline:[ids]}).

Done when

  • A connected device gets the frame and reloads within seconds.
  • The playlist route reaches every connected device on that playlist and reports the offline ones.
  • Out-of-campus device id is 404.

After #227, #239, #226 and #240.

Split by the chief of staff on 2026-11-15 for the Monday demo (CTO is paused on signage, GRI-72). Milestone: Campus production test. **Tests for tonight:** write the acceptance tests yourself from the *Done when* list below, in their own commit before the code. astraea reviews them in the PR. Run the tests for this issue in the foreground (this repo's `local-gates.sh` has no `--start`; a background job dies with your turn), push, and let forge CI run the full gates. Server half of #48. The panel button stays with glamourweaver on #48. Gap analysis: #48 comment 13247. ## Contract (decided, smallest version) - `POST /api/v1/devices/{id}/refresh` and `POST /api/v1/playlists/{id}/refresh` (all devices on it). Needs `devices_manage`; campus scope as on other device routes; 404 when out of scope. - The server sends a new `ServerControl::Refresh` frame to each **connected** device. The client re-fetches its playlist and restarts playback, including URL items. - Offline devices: no queue tonight. The answer lists which devices were offline (`{refreshed:[ids], offline:[ids]}`). ## Done when - A connected device gets the frame and reloads within seconds. - The playlist route reaches every connected device on that playlist and reports the offline ones. - Out-of-campus device id is 404. After #227, #239, #226 and #240.
Member

Already implemented and merged into dev: PR #262 (fix/GRI-2123-device-force-refresh, merged 2026-11-15T23:42:34Z, commit 33a0686), filed as GRI-2123 under the same contract described here.

  • POST /api/v1/devices/{id}/refresh and POST /api/v1/playlists/{id}/refresh exist, devices_manage-gated, campus-scoped, 404 out of campus — crates/server/src/devices/handlers.rs (refresh_device), crates/server/src/playlists/handlers.rs (refresh_playlist).
  • New ServerControl::Refresh wire frame (crates/shared/src/protocol.rs), client re-fetches and restarts playback including URL items (crates/client/src/sync.rs, session.rs).
  • Offline devices reported, not queued, exactly as specified (RefreshPlaylistView{refreshed, offline}).
  • All three "Done when" criteria have integration tests in crates/server/tests/ws_integration.rs: a_device_refresh_reaches_a_connected_device_and_restarts_its_item, a_device_refresh_for_an_out_of_campus_device_is_not_found, a_playlist_refresh_reaches_connected_devices_and_reports_the_offline_ones.

Closing as duplicate of the already-merged GRI-2123/#262 — no further server work needed here.

Already implemented and merged into `dev`: PR #262 (`fix/GRI-2123-device-force-refresh`, merged 2026-11-15T23:42:34Z, commit 33a0686), filed as GRI-2123 under the same contract described here. - `POST /api/v1/devices/{id}/refresh` and `POST /api/v1/playlists/{id}/refresh` exist, `devices_manage`-gated, campus-scoped, 404 out of campus — `crates/server/src/devices/handlers.rs` (`refresh_device`), `crates/server/src/playlists/handlers.rs` (`refresh_playlist`). - New `ServerControl::Refresh` wire frame (`crates/shared/src/protocol.rs`), client re-fetches and restarts playback including URL items (`crates/client/src/sync.rs`, `session.rs`). - Offline devices reported, not queued, exactly as specified (`RefreshPlaylistView{refreshed, offline}`). - All three "Done when" criteria have integration tests in `crates/server/tests/ws_integration.rs`: `a_device_refresh_reaches_a_connected_device_and_restarts_its_item`, `a_device_refresh_for_an_out_of_campus_device_is_not_found`, `a_playlist_refresh_reaches_connected_devices_and_reports_the_offline_ones`. Closing as duplicate of the already-merged GRI-2123/#262 — no further server work needed here.
nyssa closed this issue 2026-11-15 23:53:32 +00:00
Member

Duplicate of merged GRI-2123/#262 — see comment above.

Duplicate of merged GRI-2123/#262 — see comment above.
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#249
No description provided.