Skip to content

fix(upstream-copilot): address 5 review threads on MA PR #3611#80

Merged
trudenboy merged 1 commit intodevfrom
fix/upstream-copilot-round1
Apr 21, 2026
Merged

fix(upstream-copilot): address 5 review threads on MA PR #3611#80
trudenboy merged 1 commit intodevfrom
fix/upstream-copilot-round1

Conversation

@trudenboy
Copy link
Copy Markdown
Owner

Summary

Addresses 5 unresolved Copilot threads on the upstream MA PR #3611:

# File Severity Fix
1 eventing.py:214 CRITICAL NOTIFY now only returns on 2xx; HTTP error falls through to the next CALLBACK URL (UDA §4.1.2).
2 provider.py:_on_play CRITICAL Replace play_media(FLOW_STREAM, uri=...) with players.select_source(target, self.instance_id) so audio actually flows through our PluginSource / get_audio_stream().
3 renderer.py:_serve_scpd PROBLEM Pre-load SCPD XML bytes once in __init__; requests now serve from cache instead of blocking on Path.read_bytes().
4 provider.py:_detect_ip PROBLEM Drop hand-rolled 8.8.8.8 probe; use music_assistant.helpers.util.get_ip_addresses() (IPv6-aware, interface-ranked).
5 ssdp.py:stop PROBLEM await the cancelled _advertise_task with contextlib.suppress(asyncio.CancelledError); no more "Task was destroyed but it is pending".

Bump VERSION to 1.1.3.

Test plan

  • pytest — 62 passed
  • ruff check provider/ tests/ — clean
  • ruff format --check provider/ tests/ — clean

🤖 Generated with Claude Code

eventing: NOTIFY now only returns on 2xx, falling through to the next
  CALLBACK URL on HTTP >=300 or network error. Previously the first URL
  was treated as success regardless of status, which breaks multi-URL
  CALLBACK behaviour defined by UDA §4.1.2.

provider._on_play: replace `players.play_media(FLOW_STREAM, uri=...)` with
  `players.select_source(target, self.instance_id)`. The old call handed
  the raw upstream URI to the player, bypassing our PluginSource /
  `get_audio_stream()` proxy (and its SSRF/redirect guards). Aligns with
  the Spotify Connect plugin receiver pattern in MA.

renderer: pre-load SCPD XML bytes in `__init__` and serve from an in-
  memory cache. Previously every `/*/description.xml` hit did a sync
  `Path.read_bytes()` on the event loop.

provider._detect_ip: remove the hand-rolled 8.8.8.8 probe in favour of
  `music_assistant.helpers.util.get_ip_addresses()`, which handles IPv6
  and ranks interfaces. Socket import dropped.

ssdp.stop: after cancelling `_advertise_task`, await it with
  `contextlib.suppress(asyncio.CancelledError)` so shutdown no longer
  leaves a pending task ("Task was destroyed but it is pending").

Bump VERSION to 1.1.3.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@trudenboy trudenboy merged commit a893dbd into dev Apr 21, 2026
5 checks passed
@trudenboy trudenboy deleted the fix/upstream-copilot-round1 branch April 21, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant