screentinker/docs
ScreenTinker 9418582de5 feat(#146): always-on devices_connected + admin-toggleable /api/status debug block
1. devices_connected (always on, never gated): a top-level /api/status field next to
   loop_lag = LIVE WS socket count from the heartbeat connection map (getConnectedCount),
   NOT devices.status='online' (which lags by the offline-timeout). The single
   most-glanced operational number, so it can't disappear when debug is off. Also dropped
   4 dead per-poll COUNT(*) queries the route computed but never returned.

2. debug block behind an admin flag: new minimal app_settings KV table (none existed;
   ai_settings is per-workspace, white_labels is branding) + lib/app-settings.js (cached,
   refresh-on-write so status polls read a cached boolean, not a DB row).
   routes/status.js includes `debug` ONLY when status_debug_enabled is on (persisted value
   overrides the STATUS_DEBUG_ENABLED env default); when off the key is omitted entirely.

3. Admin toggle: GET/PUT /api/admin/status-debug (requirePlatformAdmin, mirrors the
   branding endpoints) + a checkbox in the Admin tab "Status endpoint" section
   (mirrors the branding checkbox). Takes effect on the next poll, no restart.

Tests: devices_connected always present+numeric and rises with a live socket (booted +
socket.io-client); debug present by default, admin flips OFF -> key omitted (loop_lag +
devices_connected remain) -> ON again, no restart; non-admin 403, anon 401; unit coverage
for getConnectedCount + app-settings default/override. Suite 289/289.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 18:45:40 -05:00
..
104-draft-preview-build-plan.md feat(preview): draft-aware device-free playlist preview via player reuse (#104) 2026-06-15 14:11:05 -05:00
109-android-pip-visibility.md fix(#109): render Android PiP overlay above the YouTube WebView video plane (#135) 2026-06-19 14:49:20 -05:00
134-device-reporting.md fix(#134): quiet false "reconnect" log + report HDMI output and UI render resolution (#136) 2026-06-19 15:32:11 -05:00
146-hardening-fallout.md feat(#146): always-on devices_connected + admin-toggleable /api/status debug block 2026-07-01 18:45:40 -05:00
146-hardening-plan.md docs(#146): event-loop hardening plan — blast-radius audit + failure model + sequenced plan 2026-06-30 20:44:46 -05:00
android-troubleshooting.md docs: add Android player troubleshooting & recovery guide 2026-06-03 19:58:09 -05:00
local-ai-setup.md docs: local AI setup guide for the Content Designer (#41) 2026-06-09 13:57:02 -05:00
maintenance-device-status-log.md docs(#142): 1.9.2-beta1 changelog + device_status_log VACUUM maintenance note 2026-06-27 19:59:17 -05:00
multi-tenancy-design.md Phase 1: multi-tenancy design doc + migration scripts 2026-05-11 19:37:15 -05:00
openapi.yaml docs(api): document /api/pip and the assignments muted field (#109/#129) 2026-06-18 17:36:12 -05:00