VAPP-14: Live updates: persistent control connection with server push #20
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/live-control-connection-vapp-14"
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?
Summary
Implements VAPP-14: live updates over a persistent control connection. The browser now holds ONE long-lived
/control.ashxconnection open and patches the UI from server-pushed frames, so device status, the dashboard devices-online KPI, the events list, and the statusbar all update without a reload.Unblocked by VS-32 (token-authenticated
/control.ashxupgrade), now merged into vervain-servermain.How it works
get_control_token(server fn) mints the single-use, ~60 s upgrade token via theauthcookiecontrol action's newcontrolTokenfield (VS-32) and returns the browser-facingwss://host/control.ashx?auth=<token>URL. The DIRECT path is required because the apps origin holds nomc_sessioncookie.src/live.rsis a root-level service (provided inmain.rs) that opens the socket with reconnect-and-backoff and exposes three signals over context: connection state, a node-id -> online connectivity map (from pushednodeconnectframes), and a capped newest-first event feed. A fresh token is minted per (re)connect since the token is single-use.connover fetched rows; the dashboard recomputes devices-online from the device list plus the connectivity map; the events page prepends pushed entries (deduped by id); the statusbar binds to the connection-state signal (live / reconnecting / disconnected).decode_frame) is a pure function shared by the wasm driver and tests, mirroring the server-side event mapping so a pushed event renders identically to a fetched one.Acceptance criteria
disconnectedwhen the server stays unreachable)Testing
just checkequivalents all green locally:cargo fmt --checkcargo clippy --all-targets --features server -- -D warnings(and--target wasm32-unknown-unknown)cargo check --features serverandcargo check --target wasm32-unknown-unknowncargo test --features server --bin vervain-app(15 passed, 7 new coveringdecode_frame: nodeconnect online/offline/missing-conn/missing-nodeid, logged-event mapping, source fallback, ignore of connect-burst/ack/malformed frames)🤖 Generated with Claude Code