Skip to content

Hold a client's first client/state until its clock syncs - #349

Merged
kahrendt merged 1 commit into
mainfrom
docs/first-client-state-after-clock-sync
Nov 5, 2026
Merged

kahrendt merged 1 commit into
mainfrom
docs/first-client-state-after-clock-sync

Conversation

@maximmaxim345

@maximmaxim345 maximmaxim345 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

A speaker that connects while it's playing from Bluetooth and reports available: false in its first client/state keeps its group. Once it reports true, it joins that group's playback, which may already be running. The server can't fix this alone: today a player also reports false while its clock syncs, so treating every first false as unavailable would ungroup a speaker after every network blip.

What changes

  • A client whose player or source role is active holds back its first client/state until its time filter has converged, and available no longer says anything about clock sync. A first false then always means the client is busy.
  • The server treats a first client/state with available: false as the client becoming unavailable. The client moves to a stopped solo group and rejoins only through switch.

Player commands and other roles' binary data, such as artwork on a speaker with a display, now also wait for the clock to sync, since both wait for the first client/state.

Breaking changes

  • Clients: yes. A player or source that sends available: false until its clock syncs has to hold back its first client/state instead.
  • Servers: yes. A server that keeps a client's group on a first false has to treat it as unavailable.

Clients need to update first. A server that updates before them moves those clients to a stopped solo group on every reconnect.

@maximmaxim345

This comment was marked as outdated.

@maximmaxim345
maximmaxim345 force-pushed the docs/first-client-state-after-clock-sync branch from e6cef9b to e6bdefd Compare November 4, 2026 19:19
@maximmaxim345
maximmaxim345 marked this pull request as ready for review November 4, 2026 19:19

@kahrendt kahrendt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@kahrendt
kahrendt merged commit ca9835b into main Nov 5, 2026
1 check passed
@kahrendt
kahrendt deleted the docs/first-client-state-after-clock-sync branch November 5, 2026 10:20
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sendspin Project Board Nov 5, 2026
maximmaxim345 added a commit to Sendspin/sendspin-js that referenced this pull request Nov 6, 2026
# What does this implement/fix?

<!-- Quick description and explanation of changes. -->

The player sent its first `client/state` with `available: false` until
its clock synced. A server following the updated spec ungroups a client
that opens with `available: false`, so the player would leave its group
on every reconnect.

The player now holds back its first `client/state` until its clock syncs
and always reports `available: true`. Clients without the player role
still send it right away.

**Related issue or spec PR (if applicable):**

- Sendspin/spec#349

## Types of changes

<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the
matching label, and the release notes use it to sort this change.
-->

- [x] Bugfix (non-breaking change which fixes an issue): `bugfix`
- [ ] New feature (non-breaking change which adds functionality):
`new-feature`
- [ ] Enhancement to an existing feature: `enhancement`
- [ ] Breaking change (changes the public API or the protocol in a way
that is not backwards compatible): `breaking-change`
- [ ] Refactor (no behavior change): `refactor`
- [ ] Documentation only: `documentation`
- [ ] Maintenance / chore: `maintenance`
- [ ] CI / workflow change: `ci`
- [ ] Dependencies bump: `dependencies`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants