mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 16:46:17 +00:00
Root cause of the "navigating away from /admin waits ~30s" report: the device list refreshed every device's live /info at once. Over HTTP/1.1 a browser opens only ~6 connections per origin, and it keeps the current document's in-flight requests (and their sockets) alive until a new navigation's response begins. With several offline speakers each holding an /info socket until timeout, all ~6 connections were occupied, so the next navigation (GET /) could not get a socket until a probe freed one. The page genuinely waited the full timeout before painting. Cap the live-info probes at LIVE_INFO_CONCURRENCY (3) via a small mapLimit helper, leaving sockets free for navigation and other requests. Combined with the 5s GET timeout, an offline-heavy datastore no longer stalls the UI. The device table still renders immediately from the datastore; only the live enrichment is throttled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>