mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-09-07 15:07:17 +00:00
The source inventory was expired by a 30s read-time TTL evaluated inside DeviceConnection.Status(). The status poll ticker is also exactly 30s (discovery.go), so the two ran in lockstep and every source button went disabled for the moment before each refresh. Deriving staleness per read had a second cost: two reads at the same Revision could disagree about sourcesStale, which is the only reason the browser needed mergeDerivedStatus to carry that one bit across an otherwise-rejected frame. Dropping the TTL removes that whole special case, and with it a class of "equal revision, different derived state" reasoning. Sources are now stale exactly when the last /sources read failed, recorded at merge time so every change advances Revision. An unreachable device fails its polls, so the case the TTL was meant to cover is still covered. The newer-failure-fences-older-success ordering is unchanged: the merge still runs through CompleteFieldPoll(FieldSources, ...). Drops SourcesReadAt, sourceCacheTTL, sourceCacheStatusAt, the Status() projection and mergeDerivedStatus. The TTL-boundary tests go with them; the fencing and recovery tests stay, and one of them no longer has to pin its read times to the wall clock to avoid the TTL. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>