v2026.06.03 hotfix — Sonos cast URL + UPnP picker polish #78
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hotfix for v2026.06.03's UPnP path. On-device verification with a real Sonos speaker uncovered three issues; this PR ships all three plus the operator-diagnostic plumbing that made the root-cause findable.
Root cause — UPnP error 714 from Sonos (PRIMARY FIX)
On-device tap of a Sonos device dismissed the picker sheet but no audio routed. Logcat:
UPnP error 714 = "Illegal MIME-Type" — Sonos does a HEAD/probe to detect the audio MIME at the URL. Our
cast_token.goURL builder trustedr.TLSfor the scheme, which is nil behind a TLS-terminating reverse proxy, so the URL came outhttp://. Sonos hithttp://→ 301-redirected tohttps://by the proxy → MIME probe found no audio body → 714.The Task 2 code-quality reviewer flagged this exact scenario when the slice was being merged. Fix: honor
X-Forwarded-Proto+X-Forwarded-Hostbefore falling back tor.TLS+r.Host. URL the speaker fetches now matches the scheme/host the client used.Secondary fixes
1. Sonos friendlyName too noisy in the picker. Devices showed up as
Living Room - Sonos Play:1 Media Renderer - RINCON_5CAAFD79.... The room name is buried at the start of a long ID-laden string.UpnpDiscoveryController.displayName(...)now strips on the first-for Sonos-manufactured devices so the chip shows justLiving Room/Kitchen/ etc. Generic UPnP devices that append a(192.168.x.x)IP suffix also get that stripped. Manufacturer + model still render as the row subtitle, so the device-type info isn't lost. Operator confirmed: "naming worked much better and views as expected."2. Loud diagnostic logs in
selectUpnp. The originalrunCatchingswallowed silent early-return cases (currentTrack == null,transportFor(...) == null) without any signal. Every path nowTimber.ws on early-return AND addsTimber.ibreadcrumbs through the success path (mint, SetAVTransportURI, Play, done). This made the root-cause findable in 30s of logcat scrolling.3. Release Timber tree. Debug builds had
DebugTree; release builds had nothing planted, so the diagnostic Timber.w / Timber.e calls were silently dropped in production.ReleaseTreenow plants at WARN+ viaandroid.util.Log.printlnwith the canonicalMinstreltag. Keeps DEBUG/INFO chatter out of production logcat while letting operator-drivenadb logcatsessions still see real failures.Commits
036da9de— UPnP: clean Sonos friendlyName for picker display96f12d6a— UPnP select: loud logs on every code patha9edc125— release-build Timber tree at WARN+ for operator diagnosis7d15f57e— cast token URL honors X-Forwarded-Proto / Host (the root-cause fix)Test plan
Minstrel/OutputPickerControllerbreadcrumb sequence ending in "UPnP select: done"🤖 Generated with Claude Code