Skip to content

fix(soloist): keep remote playback running on quit - #1004

Merged
LargeModGames merged 2 commits into
mainfrom
fix/soloist-quit-keeps-remote-playing
Nov 13, 2026
Merged

LargeModGames merged 2 commits into
mainfrom
fix/soloist-quit-keeps-remote-playing

Conversation

@kapok-4o

@kapok-4o kapok-4o commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #994. With the Soloist engine, quitting spotatui after playback had moved to another device (a phone) paused the music there.

  • stop in src/infra/soloist/supervisor.rs sent Pause (when the status said playing) and Deactivate on every quit. After a handoff Soloist's status follows the device that plays, and its transport commands reach that device, so the quit paused the phone.
  • The commands now come from shutdown_commands(is_active, status): none while Soloist's device is not the active one; Pause + Deactivate or just Deactivate while it is, as before.
  • The librespot engine was already right: its Pause is ignored while its device is inactive. Closing the terminal skipped stop, which is why it did not happen there.

Testing

  • cargo fmt --all --check: clean
  • cargo clippy --locked -- -D warnings, and with telemetry,tui and telemetry,tui,soloist: clean
  • cargo test --locked --no-default-features --features telemetry,tui,soloist -- soloist: 85 passed, 0 failed
  • cargo test with the gui leg's features -- typescript_bindings_are_written: passed, no binding changes

New tests: shutdown_leaves_playback_on_another_device_untouched, shutdown_pauses_active_soloist_before_deactivating_it, shutdown_deactivates_paused_or_idle_soloist_without_pausing_it. The first one fails against the old command list.

Additional notes

Not tested with a real phone handoff; the fix reads Soloist's own is_active flag, which its playback_state, auth_state and device events keep current.


💬 Questions or want to chat with other contributors? Join the spotatui Discord.

Summary by CodeRabbit

  • Bug Fixes
    • Quitting while Spotify playback is handed off to another device no longer interrupts playback; quitting during local playback continues to pause and release it.
    • Free Qobuz accounts now receive a clear message that a paid subscription is required, instead of a parse error.
    • Playback controls now update their state immediately when used through supported media controls.
    • Spotify connections allow more time to complete, and network or DNS timeouts now show a more specific message.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 160c626 and 98b8db8.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Soloist shutdown now selects commands based on whether the device is active and its playback status. Tests cover inactive devices and active devices in Playing, Buffering, Idle, and Paused states.

Changes: Soloist shutdown

Layer / File(s) Summary
Select shutdown commands by activity and status
src/infra/soloist/supervisor.rs, CHANGELOG.md
Shutdown sends no commands when Soloist is inactive. When active, it pauses before deactivation if status is Playing or Buffering, and only deactivates for other statuses. Tests cover these cases. The changelog records the playback handoff behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Merge Risk: Minimal · previous review 160c6

Quitting after playback has moved to another device should no longer pause that device. Behavior for local playback is unchanged. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the conventional-commit prefix "fix" with the scope "soloist" and states the main behavior change: remote playback keeps running when the user quits. The changeset adds shutdown_command…
Linked Issues check Passed Issue #994 requires that quitting spotatui after playback moved to another device (such as a phone) must not pause that device. The change in src/infra/soloist/supervisor.rs replaces the unconditional…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes two files. In src/infra/soloist/supervisor.rs, the change adds the Status import, the shutdown_commands helper, the updated stop body, the doc co…
Full details: Title check

Explanation

The title uses the conventional-commit prefix "fix" with the scope "soloist" and states the main behavior change: remote playback keeps running when the user quits. The changeset adds shutdown_commands, which sends no commands when Soloist is inactive, so the title matches the main change. The title is concise, imperative, and within the required format.

Full details: Linked Issues check

Explanation

Issue #994 requires that quitting spotatui after playback moved to another device (such as a phone) must not pause that device. The change in src/infra/soloist/supervisor.rs replaces the unconditional link.pause() and link.send(Command::Deactivate) in stop with shutdown_commands(snapshot.is_active, snapshot.status). When snapshot.is_active is false, the function returns an empty list, so no command reaches the other device. When Soloist is active and playing or buffering, it sends Pause then Deactivate. When Soloist is active and paused or idle, it sends only Deactivate. This keeps the existing local-playback behavior. In src/infra/soloist/link.rs, is_active is updated by the Auth, State, and Device events, so the flag used for the decision is kept current. Three unit tests cover inactive playback across Playing, Buffering, Paused, and Idle, active playback that pauses, and paused or idle playback that only deactivates. The issue's reproduction path (q then y) reaches stop. I did not inspect the quit call site directly, and a real phone handoff was not tested, so that end-to-end path rests on the PR description and code review.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes two files. In src/infra/soloist/supervisor.rs, the change adds the Status import, the shutdown_commands helper, the updated stop body, the doc comment, and three tests for the shutdown behavior. Each of these serves issue #994. In CHANGELOG.md, the only added line is the #994 entry under Fixed. The other Fixed entries (#984, #985, #977) already exist at the merge base and are not added by this PR. No unrelated behavior or code changes are present.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4c5fc99 and 160c626.

Files selected for processing: 2

  • CHANGELOG.md
  • src/infra/soloist/supervisor.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit d6d3d24 into main Nov 13, 2026
39 checks passed
@LargeModGames
LargeModGames deleted the fix/soloist-quit-keeps-remote-playing branch November 13, 2026 22:55
LargeModGames pushed a commit that referenced this pull request Nov 23, 2026
# Summary

Starting another source after a Soloist handoff could pause Spotify on
the other device. Soloist could still report a playing status after its
own device became inactive.

Require an active Soloist device before queueing Pause or Deactivate.
Pause also requires playing or buffering. Check the device activity
generation again before submitting either command to the WebSocket. This
drops commands from before a handoff, even if Soloist becomes active
again.

Related to [#994](#994)
and the quit fix in
[#1004](#1004).

# Testing

Ran on Apple Silicon macOS with isolated app paths.

~~~text
cargo fmt --all --check
Exit 0. No output.

cargo clippy --locked --no-default-features --features telemetry,tui --
-D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s

cargo clippy --locked -- -D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s

cargo clippy --locked --no-default-features --features
telemetry,tui,soloist,local-files -- -D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.52s

cargo test --locked --no-default-features --features
telemetry,tui,soloist,local-files --lib -- soloist
    Finished `test` profile [unoptimized + debuginfo] target(s) in 9.82s
test result: ok. 88 passed; 0 failed; 0 ignored; 0 measured; 2415
filtered out; finished in 0.03s

cargo test --locked --no-default-features --features telemetry,tui
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.45s
test result: ok. 2042 passed; 0 failed; 0 ignored; 0 measured; 0
filtered out; finished in 3.68s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
out; finished in 0.00s
~~~

Four regressions failed when the enqueue activity check and the writer's
generation comparison were temporarily removed. All four passed with
both checks restored.

~~~text
test result: FAILED. 84 passed; 4 failed; 0 ignored; 0 measured; 2415
filtered out; finished in 0.02s
~~~

# Additional notes

Tests use simulated Soloist events. A real Soloist session and phone
handoff remain unverified. A frame already submitted to the WebSocket
may still complete during a handoff.


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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Soloist handoffs now pause local playback only when the device is
active and playback is playing or buffering.
* Queued pause and deactivation commands are discarded if the device
changes state or hands off before they can be applied.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: 2570165831 <[email protected]>
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.

[Bug] Music playing on another device gets stopped when exiting spotatui using soloist

2 participants