Skip to content

fix: IoEvent::Repeat from a plugin changes Spotify's repeat while internet ra... - #390

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
yhay81:agent/issue-376
Jul 19, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
yhay81:agent/issue-376

Conversation

@yhay81

@yhay81 yhay81 commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Refs #376. Partial fix: this covers the internet-radio path only, so #376 stays open. See the follow-up comment on the issue for what is left.

Summary

IoEvent::Repeat from a plugin changes Spotify's repeat while internet radio plays

Validation

  • Mechanical gate: +17/-2, tests passed
  • Adversarial review: approved

🤖 AI-authored PR, operated by @yhay81.

Summary by CodeRabbit

  • Bug Fixes
    • Repeat commands are now safely ignored during active live-stream playback, preventing unintended forwarding and session interruptions.
    • Repeat commands continue to pass through normally when no live-stream session is active.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Radio dispatch now consumes IoEvent::Repeat as a no-op while an active radio session owns playback. Tests verify it remains unhandled without a session and does not tear down active radio playback.

Changes

Radio Repeat Event Handling

Layer / File(s) Summary
Consume repeat events during radio playback
src/infra/radio/dispatch.rs
Live-stream documentation and routing now include IoEvent::Repeat(_) among active-session no-op events. Tests cover both inactive-session fall-through and active-session consumption without teardown.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The patch fixes the radio path, but it does not cover the local, Subsonic, and YouTube routing paths called out in #376. Extend the Repeat guard to the local, Subsonic, and YouTube dispatch paths so unsupported repeat is rejected consistently everywhere.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The diff stays focused on radio Repeat handling and related tests, with no unrelated changes introduced.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses a valid conventional-commit prefix and matches the fix for plugin repeat events affecting Spotify during radio playback.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Comment @coderabbitai help to get the list of available commands.

@LargeModGames
LargeModGames merged commit cca1d51 into LargeModGames:main Jul 19, 2026
11 checks passed
LargeModGames added a commit that referenced this pull request Sep 2, 2026
…ck (#503)

# Summary

Closes the second half of #376. After #390 closed the internet-radio
path, a plugin's `set_repeat` still reached the user's real Spotify
device whenever the native queue slot owned playback:
`Action::SetRepeat` dispatches a raw `IoEvent::Repeat`, no router
consumed it, and `Network::repeat` changed repeat on a track the user
was not listening to, with nothing on screen to show for it. This is
reachable in a plain `default` build.

The fix is a `Repeat` arm in `route_queue_event`, gated on
`queue_owns_playback()`. That router is compiled unconditionally and
runs first in the pump, so it covers the Spotify and decoded queue slots
in one place without touching the per-source dispatchers. It sets the
same "Repeat does not apply to this source" status the keyboard path
uses, so the plugin caller gets the same answer as the key.

`set_shuffle` does not have the same hole: `Action::SetShuffle` goes
through `App::shuffle`, which already carries the queue-slot guard.

# Testing

- `cargo fmt --all -- --check`
- `cargo clippy --no-default-features --features telemetry,tui -- -D
warnings`: clean
- `cargo test --no-default-features --features telemetry,tui`: 906
passed
- `cargo clippy -- -D warnings`: clean
- `cargo test`: 1208 passed, including the new
`repeat_is_refused_while_the_queue_slot_owns_playback` (gated on
`streaming`, since the slim build's `QueueNowPlaying` has no variants)
- `tools/check_gates_ratchet.sh origin/main`: ok

Not verified: a live run with a Lua plugin calling `set_repeat` over a
queued track.

# Additional notes

`test_attribute_total` moves 1770 to 1771 in `tools/gates.count` for the
new test.

---
<sub>💬 Questions or want to chat with other contributors? Join the
[spotatui Discord](https://spotatui.com/discord).</sub>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Queue playback now handles repeat actions directly while playback is
active and displays a status message.
* Repeat actions continue to be forwarded normally when the queue does
not control playback.

* **Tests**
  * Added coverage for repeat handling in both playback scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

2 participants