You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(soloist): keep remote playback running on source handoff - #1137
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.
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.
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.
LargeModGames/spotatui#1004: Also changes Soloist pause and deactivation behavior based on whether the device is active.
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: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Four regressions failed when the enqueue activity check and the writer's generation comparison were temporarily removed. All four passed with both checks restored.
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