Skip to content

Update for sendspin-rs v0.2.0 breaking API changes#35

Merged
teancom merged 2 commits intomainfrom
fix/sendspin-rs-update
Apr 20, 2026
Merged

Update for sendspin-rs v0.2.0 breaking API changes#35
teancom merged 2 commits intomainfrom
fix/sendspin-rs-update

Conversation

@teancom
Copy link
Copy Markdown
Contributor

@teancom teancom commented Apr 17, 2026

Adapt to the breaking changes that landed in sendspin-rs between our previous pin and the v0.2.0 release:

  • ClientState gained state: Option<ClientSyncState> and PlayerState lost its sync state field; switch to ClientSyncState::Synchronized at the ClientState level and use PlayerState::default() to absorb newly-added optional fields (static_delay_ms, supported_commands).
  • ControllerCommand.command moved from String to ControllerCommandType; add a string→enum mapping at the command channel boundary.
  • ServerCommand is now a typed Message variant with PlayerCommandType, replacing the manual JSON parsing of server/command payloads.
  • ClockSync::new() now requires Arc; t1/t4 must come from Clock::now_micros() (raw monotonic, NTP-immune) rather than SystemTime::now() against UNIX_EPOCH.
  • Bump cpal 0.15 → 0.17 to match the version sendspin-rs leaks through its public API (SyncedPlayer takes cpal::Device); update device enumeration for cpal 0.17's deprecation of name() in favour of description() and the SampleRate wrapper removal.

teancom and others added 2 commits April 16, 2026 20:13
Adapt to the breaking changes that landed in sendspin-rs between our
previous pin and the v0.2.0 release:

- ClientState gained `state: Option<ClientSyncState>` and PlayerState
  lost its sync state field; switch to ClientSyncState::Synchronized
  at the ClientState level and use PlayerState::default() to absorb
  newly-added optional fields (static_delay_ms, supported_commands).
- ControllerCommand.command moved from String to ControllerCommandType;
  add a string→enum mapping at the command channel boundary.
- ServerCommand is now a typed Message variant with PlayerCommandType,
  replacing the manual JSON parsing of `server/command` payloads.
- ClockSync::new() now requires Arc<dyn Clock>; t1/t4 must come from
  Clock::now_micros() (raw monotonic, NTP-immune) rather than
  SystemTime::now() against UNIX_EPOCH.
- Bump cpal 0.15 → 0.17 to match the version sendspin-rs leaks
  through its public API (SyncedPlayer takes cpal::Device); update
  device enumeration for cpal 0.17's deprecation of name() in favour
  of description() and the SampleRate wrapper removal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI runs Rust 1.95 where clippy promotes `.map(<f>).unwrap_or(<a>)` on
Result to a hard error under -D warnings. Local toolchains pre-1.95
don't catch this. Replace with the equivalent `.map_or(<a>, <f>)`,
which is the exact replacement clippy suggested.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teancom teancom added the enhancement New feature or request label Apr 17, 2026
@teancom teancom self-assigned this Apr 17, 2026
@teancom teancom requested a review from marcelveldt April 17, 2026 03:39
@teancom teancom marked this pull request as draft April 18, 2026 02:53
@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented Apr 18, 2026

I'm trying to track down an audio glitch bug in the desktop app that I found from testing this. I'll come back and mark it as ready for review when I've figured out where it's coming from.

@RobinDadswell
Copy link
Copy Markdown
Contributor

I'm trying to track down an audio glitch bug in the desktop app that I found from testing this. I'll come back and mark it as ready for review when I've figured out where it's coming from.

Have a look at #34 as this fixes the audio glitch bug

@teancom teancom marked this pull request as ready for review April 20, 2026 03:35
@teancom
Copy link
Copy Markdown
Contributor Author

teancom commented Apr 20, 2026

Tracked down the audio glitch I was looking at, it's not a result of this change. But we'll should follow this up relatively quickly with #34

@teancom teancom merged commit 43e28d2 into main Apr 20, 2026
1 check passed
@teancom teancom deleted the fix/sendspin-rs-update branch April 20, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants