Skip to content

fix(soloist): keep remote playback running on source handoff - #1137

Merged
LargeModGames merged 1 commit into
mainfrom
fix/soloist-pause-only-when-active
Nov 23, 2026
Merged

LargeModGames merged 1 commit into
mainfrom
fix/soloist-pause-only-when-active

Conversation

@kapok-4o

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

Copy link
Copy Markdown
Collaborator

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 and the quit fix in #1004.

Testing

Ran on Apple Silicon macOS with isolated app paths.

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.

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.

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.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Soloist pause requests are queued only when the device is active and playback is playing or buffering. Queued pause and deactivation commands are checked against the device’s activity generation before submission, so commands from an earlier handoff are skipped.

Changes: Soloist handoff command handling

Layer / File(s) Summary
Command eligibility and activity state
src/infra/soloist/link.rs
Queued commands carry optional activity-generation metadata. Pause requests are queued only for an active device that is playing or buffering. The generation changes when the active device changes.
Guarded command writing and integration checks
src/infra/soloist/supervisor.rs, src/core/app/soloist.rs, src/core/app/transport.rs, changelog.d/fixed/994-soloist-source-handoff.md
The supervisor checks queued commands against the current activity generation before writing them. Tests cover handoffs, decoded playback, and pause eligibility. The changelog describes the behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to f6524

This change stops stale Soloist pause and deactivate commands from pausing Spotify on another device after a handoff. The guard checks both device activity and a generation counter before a command is submitted. No concrete defect remains in the reviewed change, and the tests cover the handoff and reactivation cases. Only a manual check against a real Soloist session and phone handoff is still outstanding.

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", which matches the required format. It states the main change: the PR keeps remote playback running on a source handoff by …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional-commit prefix "fix" with the scope "soloist", which matches the required format. It states the main change: the PR keeps remote playback running on a source handoff by blocking stale Soloist Pause and Deactivate commands. The changeset adds activity-generation checks in SoloistLink, the supervisor writer, and the changelog entry, so the title matches the change.

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 810e19d and f65249b.

Files selected for processing: 5

  • changelog.d/fixed/994-soloist-source-handoff.md
  • src/core/app/soloist.rs
  • src/core/app/transport.rs
  • src/infra/soloist/link.rs
  • src/infra/soloist/supervisor.rs

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

@codecov

codecov Bot commented Nov 22, 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 f20f58b into main Nov 23, 2026
39 checks passed
@LargeModGames
LargeModGames deleted the fix/soloist-pause-only-when-active branch November 23, 2026 13:58
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