Repository navigation
v3.51 — S1 performance, queue visibility, batch track adds
v3.51 — 2026-04-23
Performance-focused maintenance release targeting Sonos S1 hardware and other
request-sensitive coordinators, plus the queue-visibility polish that surfaced
while diagnosing it.
S1 performance
GetHouseholdIDcached per device — speakers' household IDs never change
at runtime. Previously we re-queried on every SSDP response (13+ extra SOAP
calls per 30-second rescan cycle); now fetched exactly once per device for
the app's lifetime.- Topology refresh throttling (10 s per household) — SSDP response bursts
(home-theater bundles advertising each sub-device separately) no longer
trigger back-to-backGetZoneGroupStatecalls. User-initiated group changes
(joinGroup,ungroupDevice, preset apply) passforce: trueto bypass
the throttle for immediate UI feedback. - Removed redundant queue pre-count —
AddURIToQueueused to do an extra
Browse(Q:0) count=1just to compute the insertion position before the
actual add. Sonos'sDesiredFirstTrackNumberEnqueued=0natively means
"append at end"; the pre-count is gone, cutting one round-trip per add. - Single-track optimistic queue append — single-track
AddURIToQueuenow
posts the newQueueItemvia a userInfo payload on.queueChangedso the
queue panel appends it locally without an extraBrowse(Q:0)reload. Per
single-track add: 3 SOAP calls → 1. - Batch track adds via
AddMultipleURIsToQueue— album adds and multi-
select enqueues now go through a single SOAP call per 16-track chunk (Sonos
firmware limit) instead of N sequentialAddURIToQueuecalls. On S2 a
14-track album completes in ~1-2 s. - Auto-fallback to per-track on batch rejection — if the firmware rejects
the batch action (UPnPError 402 or similar), the code transparently falls
back to sequentialAddURIToQueuewith the already-known URIs. Slower but
always works on the S1 firmware versions that don't accept the batch form. - Corrected
AddMultipleURIsToQueuewire format — original implementation
was double-escaping each DIDL (pre-escape + envelope escape) producing
<DIDL…on the wire, which the speaker parsed as invalid args and
rejected with 402. Now follows the SoCo / node-sonos-ts / jishi convention:
raw DIDL joined with a single ASCII space, single XML-escape at envelope
level only. - Per-track fallback breaks on first timeout — avoids hammering an already-
unresponsive S1 with a dozen more doomed SOAP calls after the first one
times out. Whatever succeeded before the break is reported; the failure
surfaces in the red error banner.
Queue visibility
- Clear Queue spinner — the trash icon swaps to a spinner while the
RemoveAllTracksFromQueueSOAP is in flight. - Queue loading spinner on every load —
loadQueuenow always sets
isLoading = trueat the start. Full-screen "Loading queue…" spinner when
the panel has no items to show (first launch, speaker switch, cleared
queue). Inline header spinner when items are already present, so the
existing list stays visible during a background reload. - "Adding to queue…" spinner during in-flight adds — new
@Published isAddingToQueueonSonosManagerdrives a spinner in the queue panel
while a batch add is progressing, not only during the final reload. On
S1 where the per-track fallback takes 30-40 s, the spinner covers the
whole operation. - Green info banner on successful adds —
ErrorHandler.info(_:)shows a
transient green banner at the top of the window ("Add to Queue: 14
tracks"). An immediate "Adding N tracks…" banner appears the moment the
action is invoked, so the user gets feedback before any SOAP round-trip
completes. Red error banner surfaces SOAP faults that were previously
being swallowed bytry?.
Queue synchronisation
- Speaker-switch queue reload —
QueueViewnow reacts to the external
groupprop changing (previously the@StateObjectheld on to the
originally-captured group). Switching speakers now clears the queue,
updatesvm.group, and triggersloadQueueagainst the new coordinator.
Bug fixes
- "+ Float Play 5 + Office" display glitch —
SonosGroup.nameno longer
emits a leading "+ " when the coordinator isn't present in the members
list (transient topology inconsistency edge case).
Removed
- Topology grace windows — the group-level and member-level grace timers
introduced earlier in v3.5 turned out to create phantom groups under
Sonos's topology eventual-consistency quirks, and to delay user-initiated
grouping actions by up to 30 s. Replaced by a simple latest-response-wins
merge that accurately reflects what the most recent speaker said.
Known limitations
- Switching speakers while a multi-track batch add is in flight can leave
the queue panel targeting the wrong coordinator for its post-add reload —
tracked under the top High Priority item indocs/TODO.mdfor a proper
fix. Workaround: wait for the green "Add to Queue: N tracks" banner before
switching rooms.