Force refresh of a device or a playlist from the panel, including URL items #48
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#48
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
Panel button that makes a device reload now.
Done when
The device reloads within seconds of the click.
Depends on
#16
Plan
plan/shared/protocol.md
Routing/Hold: no agent is routed to this issue automatically. To take it yourself, assign yourself. Vivy removes the hold when it is handed to an agent.Created for GRI-1818 from
plan/overview/roadmap.mdand the MVP plan on GRI-1761.Live force refresh of a deviceto Force refresh of a device or a playlist from the panel, including URL itemsAsked by the product owner (GRI-2051, 2026-11-15 17:37 UTC): "put a button on a playlist and device that forces an update of a playlist, and if there are URL objects, that we can force refresh those too from the panel."
This widens #48 and moves it to Campus production test:
Done when
Looked at what exists before building against it (no branch/commits yet — this is a contract/test check, not implementation).
The "Live command" protocol family this needs does not exist yet.
plan/shared/protocol.mdlists it explicitly as*Later*, not MVP:ServerControl(crates/shared/src/protocol.rs) has onlyPlaylistPush,PlaylistCleared,MediaManifest,TransferOffer,Unknown. There is noRefresh(or any live-command) variant to push down the socket.ClientMessagehas onlyRegistration,Heartbeat,TransferAccept,TransferComplete,Unknown. There is no client → server acknowledgement frame a refresh command could use to report "confirmed".DeviceConnections::push(crates/server/src/connections.rs:121) already exists and can send anyServerControlto a connected device, andAuditCategory::LiveCommandsalready exists incrates/shared/src/audit.rs— so the plumbing to add this family to is there, but the family itself isn't built.approve/block/rename/campus-reassign (crates/server/src/devices.rsroutes) — nothing a panel button could call to ask for a refresh.Devicerow or elsewhere.crates/client/src/renderer/web.rsrenders URL items, but there is no reload/re-fetch command it currently listens for.This overlaps directly with #228, which is blocked on the same shape of gap (forge #228 comment 13174, board GRI-2103): this issue's "Devices screen shows when the last refresh was asked and confirmed" needs the rollout-status stream (
crates/server/src/rollout_status.rs) extended with refresh-asked/confirmed state, which is the same server surface #228 is waiting on a contract for.No tests exist for this either.
grep -ril refresh frontend-web/src --include='*.test.*'and the same overcrates/server/testsandcrates/clientboth come up empty for anything matching a force-refresh/live-command flow.Per process (tests first, written by QA; API shape agreed with backend before building against it), I don't have a contract or acceptance tests to build the frontend half against. Questions that need backend design before I can implement the panel side:
ServerControl/ClientMessagepair for refresh request + confirmation, and does it bumpPROTOCOL_VERSION?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).Routing by the chief of staff, for the Monday demo. Server half split to #249 (nyssa), contract decided there:
POST /devices/{id}/refreshandPOST /playlists/{id}/refresh, answer{refreshed, offline}, no offline queue tonight. glamourweaver: panel button against that contract, after #242 and #228.CI on #261 had failed:
frontend-web's design-system test (src/designSystemButtons.test.ts) correctly caught that both Refresh buttons usedgx-btn--secondary(red/danger) instead of neutral — contradicting my own PR description. Fixed by switching DevicesScreen.tsx and PlaylistDevicesTab.tsx togx-btn--neutral; verified withnpm run check(prettier, oxlint, tsc, vitest) — all 132 tests pass.Branch was also 4 commits behind dev; merged origin/dev in cleanly (no conflicts, no overlap with the refresh work — those commits were unrelated device/campus/permission changes).
Pushed as
9e36168. CI re-queued, ETA ~4m. Still holding merge until nyssa's #249 lands.Found and fixed a contract mismatch before merging, caught by reading nyssa's #262 (the server half) rather than assuming the earlier written contract still held verbatim:
POST /devices/{id}/refreshanswers{"refreshed": bool}— a single device has no fan-out, so there's noofflinelist — whilePOST /playlists/{id}/refreshanswers{"refreshed": [ids], "offline": [ids]}as originally agreed. MyhttpDevicesApi.tshad assumed both routes shared the playlist's array shape; fixed to decode the device route's bool and deriverefreshedIds/offlineIdsfrom it. The mock API and tests were already written against the correct per-screen behavior (they don't touch the HTTP layer), so no test changes were needed — this was an HTTP-decoding bug only, not a behavior bug.Verified:
npm run check(prettier, oxlint, tsc, vitest) — all 132 tests pass. Pushed as48762f7, CI re-running.#262 (nyssa's server half) is open with CI green but not yet merged. Holding #261's merge until #262 lands on dev, per the agreed order.
While waiting on #249/#262 landing, re-reviewed #261 and found review #500 (official, REQUEST_CHANGES, never dismissed) was never actually addressed: the panel notice "Will refresh when online." is false under #262's no-offline-queue design — survived two review rounds because each round's fix addressed a different flagged issue instead. Fixed now in
9cb1795: DevicesScreen.tsx and PlaylistDevicesTab.tsx say "offline; not refreshed" instead. Updated the two matching test expectations (mine, no QA tests existed for this issue). Verified: vitest 30/30, tsc, oxlint, prettier all clean. Merged dev in cleanly. CI queued on #261.GRI-2123 (#262, nyssa's server half) merged to dev. Rebased my branch (feature/GRI-2114-panel-force-refresh, PR #261) onto dev with no conflicts and confirmed the landed response shapes match what my frontend decodes: devices/{id}/refresh -> {refreshed: bool}, playlists/{id}/refresh -> {refreshed:[ids], offline:[ids]}. Re-verified: vitest 30/30, tsc clean, oxlint clean, prettier clean. Pushed as
0fd6268; CI queued.Landed: PR #261 merged to dev at 00:16:21 UTC (merge commit
5924008). Panel has a "Refresh" button on an approved device (DevicesScreen) and a "Refresh all devices" action on a playlist Devices tab (PlaylistDevicesTab), gated on devices_manage, built against #262 server contract: POST /devices/{id}/refresh -> {refreshed: bool}, POST /playlists/{id}/refresh -> {refreshed:[ids], offline:[ids]}. States covered: loading, success, offline-not-refreshed note, error, hidden without permission. Verified: vitest 30/30, tsc clean, oxlint clean, prettier clean, forge CI green.