Skip to content

Keep the dynamic pairing code stable across retries within an attempt - #237

Merged
maximmaxim345 merged 1 commit into
mainfrom
ap/stable-dynamic-pairing-code-within-attempt
Sep 9, 2026
Merged

maximmaxim345 merged 1 commit into
mainfrom
ap/stable-dynamic-pairing-code-within-attempt

Conversation

@arturpragacz

@arturpragacz arturpragacz commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Keep the dynamic pairing code stable across retries within an attempt.

Closes #201.

Comment thread pairing.md Resolved
@arturpragacz
arturpragacz force-pushed the ap/stable-dynamic-pairing-code-within-attempt branch from 7015a1a to 71b9ab4 Compare September 9, 2026 09:46

@maximmaxim345 maximmaxim345 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @arturpragacz !

@maximmaxim345
maximmaxim345 merged commit a09b2c0 into main Sep 9, 2026
2 checks passed
@maximmaxim345
maximmaxim345 deleted the ap/stable-dynamic-pairing-code-within-attempt branch September 9, 2026 09:47
maximmaxim345 added a commit that referenced this pull request Sep 10, 2026
Removes the digit audio pack that #173 introduced. During initial
pairing the pack came from an unauthenticated peer, which thereby chose
what the client's speaker played and drove the client's audio decoders
before any trust was established. Speaking clients return to their own
bundled voice, choosing the language against the server's `languages`
hint in `server/hello` under RFC 4647 Lookup matching, as before #173.

Hand revert rather than `git revert`: #179, #194 and #237 have since
rewritten the surrounding text, and the `languages` move from
`server/activate` to `server/hello` in #173 stays, since
`client/pair-pending`'s `message` field relies on it.

Changes, all in `messaging.md` and `pairing.md` with `README.md`
regenerated:

- Binary message ID `2` returns to the reserved `2-3` range.
- `server/activate` `pairing.format?` no longer conditions `digits` on
fitting a pack.
- Sequence diagram, Digits emission, Protocol Errors, the
`dynamic_pairing_code` descriptor (`digit_audio` removed; `out_channels`
unchanged), the Messages intro, `client/pair-init` and
`server/pair-init` lose their pack references.
- The `Server → Client: Digit Audio Clip (Binary)` section is removed.

Closes #203

---------

Co-authored-by: Maxim Raznatovski <[email protected]>
maximmaxim345 added a commit to Sendspin/sendspin-js that referenced this pull request Oct 27, 2026
# What does this implement/fix?

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

A mistyped dynamic pairing code ended the whole pairing attempt, and
after 10 failures every attempt needed the pairing window, with no way
to reset the count.

Now a wrong code starts another round with the same code. After 20
rounds without a correct code, attempts wait until the app calls
`releasePairingHold()` on a deliberate action on the device, which also
resets the count.

This also fixes a few other gaps with the spec:
- The static pairing window now stays open across attempts, so a
timed-out or cancelled attempt no longer needs a new gesture. It closes
on a completed pairing, the fifth wrong code, a drop of the connection
that used it, or `cancelPairing()`.
- Pairing messages that arrive out of sequence now close the connection
instead of being ignored. Messages still in flight after the client's
own `pair/abort` are still dropped.
- The sample player shows the dynamic code as `123-456` and speaks it
with a pause between groups.

This is a breaking change: `isDynamicPinEscalated()` is now
`isRoundLimitReached()`, and `releasePairingHold()` replaces
`openPairingWindow()` for releasing held-back dynamic pairing attempts.

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

- Sendspin/spec#194
- Sendspin/spec#237
- Sendspin/spec#312

## 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.
-->

- [ ] 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`
- [x] 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

None yet

Development

Successfully merging this pull request may close these issues.

Keep the dynamic pairing code stable across retries within an attempt

2 participants