DeviceManager: order-based discovery (extracted from #865) - #872
Draft
Christian-Holbrook wants to merge 1 commit into
Draft
DeviceManager: order-based discovery (extracted from #865)#872Christian-Holbrook wants to merge 1 commit into
Christian-Holbrook wants to merge 1 commit into
Conversation
Extracted from #865, rebased onto master's RCE-aware DeviceManager. Triggers (startup, sleep, network change, config change, refresh click, unhealthy device, staleness timers) now submit orders instead of scanning directly. Orders queue in per-type pending sets (broadcast/reconcile) and are fulfilled only by visible views, so nothing hits the network while no one is looking. Reasons accumulate and dedupe; one fulfillment satisfies all queued reasons; stale orders are staleness-gated and skipped by live fulfillment. The freshness rewrite from #865 (ensureDeviceFresh, peekDevice, cache trust windows, getDeviceInfo consolidation) is intentionally NOT included; reconcile() drives the existing healthCheckAllDevices(force) machinery. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extracts just the orders system from #865, re-grafted onto current master (which has since gained Roku Cloud Emulator support — the source of #865's conflicts).
Triggers no longer scan/health-check directly. Instead they submit orders into per-type pending sets, and visible views fulfill them:
broadcast(SSDP scan) andreconcile(health-check all), each with a reason (startup,network,sleep,refresh-clicked,config-changed,unhealthy-device,stale).takeis atomic per type.order-submittedevent (replacingscanNeeded-changed); timer-drivenstaleorders are excluded from live fulfillment and are staleness-gated insidebroadcast().unhealthy-devicerescan is now a rate-limited order (1/min), terminating the old scan → fail → scan feedback loop.scanNeededflag,setScanNeeded,refresh(),scan(),discoverAll().What this deliberately does NOT include from #865
The freshness rewrite (
ensureDeviceFresh,peekDevice,lastCheckedByIptrust windows,getDeviceInfoconsolidation, hidden-view lazy reads).reconcile()drives the existinghealthCheckAllDevices(force)machinery unchanged;healthCheckDevicekeeps its current signature.Testing
BaseWebviewViewProvidertimeout also fails on clean master (pre-existing, unrelated).🤖 Generated with Claude Code