Add language hint for spoken dynamic PIN - #131
Merged
Merged
Conversation
arturpragacz
changed the base branch from
main
to
ap/improve-pin-pairing-window
August 4, 2026 00:05
arturpragacz
force-pushed
the
ap/language-hint-for-spoken-dynamic-pin
branch
from
August 4, 2026 00:22
c219c49 to
930dafb
Compare
maximmaxim345
approved these changes
Aug 5, 2026
maximmaxim345
left a comment
Member
There was a problem hiding this comment.
Looks good, just left one comment about possibly expanding languages for other uses too.
But thats not blocking this PR and just an idea. We can discuss/add that separately to this change.
| - `pairing?`: object - parameters of the pairing attempt this activation admits. Required when `'pairing'` is in `activities`; absent otherwise. A client ignores this field when `activities` does not include `'pairing'`. | ||
| - `method`: 'dynamic_pin' | 'pairing_psk' | 'static_pin' - pairing method the server picked, drawn from the client's `supported_pair_methods`. | ||
| - `pin_length?`: integer - the dynamic [PIN length](pairing.md#dynamic-pin-pairing-flow) for this session. Required when `method` is `'dynamic_pin'`; absent otherwise. | ||
| - `languages?`: string[] - non-empty list of [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tags in descending operator preference (e.g. `["ca", "es", "en"]`), for spoken [PIN emission](pairing.md#dynamic-pin-pairing-flow). Optional when `method` is `'dynamic_pin'`; absent otherwise. |
Member
There was a problem hiding this comment.
Just an idea: should we allow sending languages regardless of the selected method? Still optional for the server, but clients could use it for other things, like translating the UI they show.
Contributor
Author
There was a problem hiding this comment.
Hmm, if we would want a hint for translating the whole client UI, then I think we would have to make it a global option, and not just here in pairing then.
maximmaxim345
marked this pull request as ready for review
August 5, 2026 12:28
maximmaxim345
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Aug 10, 2026
Add PIN language and secret locations hints. Implements Sendspin/spec#131 and Sendspin/spec#132 for server side. --------- Co-authored-by: Maxim Raznatovski <nda.mr43@gmail.com>
maximmaxim345
added a commit
to Sendspin/sendspin-js
that referenced
this pull request
Aug 11, 2026
Aligns the client with the new pairing spec changes and moves the E2E dependency to aiosendspin 9.0.0. On the Spec side, this PR implements: - Sendspin/spec#129 - Sendspin/spec#130 - Sendspin/spec#131 - Sendspin/spec#132. ## Pairing `server/activate` now carries a `pairing` object (`method`, `pin_length`, `languages`) in place of `selected_pair_method`, and `pin_length` moved out of `server/pair-init` so the client validates it before an attempt starts. Terminal lockout is gone: a single dynamic-PIN failure counter escalates the method to gesture-gating at ten failures and de-escalates on the next verified round, so repeated wrong PINs can no longer leave a device permanently unpairable. A gesture-gated attempt signals `client/pair-pending` and waits for `openPairingWindow()` rather than closing the connection after five minutes, and a window opened before the server asks now survives a reconnect instead of being silently discarded. Clients can advertise where the operator finds each static secret through `locations`, and which channels convey the dynamic PIN through `out_channels`. A server's spoken-PIN language preference reaches the app as a second argument to `onPairingPin`; the sample player uses it to read the PIN aloud in the operator's language. ## Breaking changes `isPairingLockedOut()` and `clearPairingLockout()` are removed in favour of `isDynamicPinEscalated()`, since escalation has no operator exit other than a successful round. `onPairing` gained a `pending` event and `onPairingPin` a second `languages` argument. New optional config: `pinOutChannels`, `staticPinLocations` and `pairingPskLocations`, all omitted from `client/hello` when unset.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add language hint for spoken dynamic PIN.