/
/
/
# What does this implement/fix? Adding a Chromecast-bridged speaker to a Sendspin group waits up to 30 seconds for the Cast app to report ready. When that wait timed out and the Cast app then reported a failure while the group was being rolled back, the failure also showed up in the log as a stray `ERROR ... exception in shielded future` with a traceback — on top of the clear error the user already gets. The readiness wait no longer takes ownership of those futures, so only the real error is reported. Follow-up to #5288, #5295 and #5453. The other remaining `asyncio.shield` uses were checked and left alone: their shielded work either can't fail or can't be waited on by a cancelled caller, so they never produce this log entry. **Related issue (if applicable):** - n/a ## Types of changes - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Changes - Wait for Cast member readiness with `asyncio.wait` instead of a shielded `gather`, so a member failing after the timeout no longer reaches the loop error handler. - A member's own failure (e.g. audio unsupported) still wins over the generic readiness timeout. - Named the duplicated 30s readiness timeout `CAST_APP_READY_TIMEOUT`. - Added tests covering the late failure, the member failure and the timeout message. One knock-on: if a member's readiness is superseded while the group is still waiting, the failure now surfaces when the wait ends instead of straight away. Same outcome, just not as quick, and it takes a rare bit of timing to hit. ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.