Skip to content

Require a new pairing gesture after the client hits the round limit - #627

Merged
maximmaxim345 merged 2 commits into
mainfrom
fix/reset-pairing-round-count
Nov 17, 2026
Merged

maximmaxim345 merged 2 commits into
mainfrom
fix/reset-pairing-round-count

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

What does this implement/fix?

A pairing window the operator opened before or during a dynamic pairing code attempt that then hit the 20 round limit lifted the hold on the next attempt and reset the round count. The spec only lets a verified server_kc or an operator action made after the limit reset it.

The client now closes that window when the attempt ends at the limit, so the next attempt sends client/pair-pending and waits for a new gesture. A window opened after the limit still lifts the hold as before.

Related issue or spec PR (if applicable):

Types of changes

  • 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

A pairing window the operator opened before or during a dynamic
pairing attempt that then reached the round limit later lifted the
hold-back and reset the round count.

Copilot AI 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.

🟡 Changes recommended

Pairing cleanup can leave the code displayed and output channel suspended if the round-limit query fails or is cancelled, and can incorrectly close a fresh gesture window.

3 open issues
What changed in this PR

This PR tightens the client’s dynamic pairing-code flow to align with Sendspin spec PR #312: an earlier pairing gesture must not reset the round limit for the next attempt.

Changes:

  • Closes an admitting pairing window when an attempt ends at the round limit.
  • Adds a regression test confirming the next attempt sends client/pair-pending and preserves the round count.
File Description
tests/​test_client_pairing.py Tests that a window opened during an attempt cannot bypass the next hold-back.
aiosendspin/​client/​connection.py Adds pairing-window cleanup when the round limit is reached.

Review effort: Balanced

Comment thread aiosendspin/client/connection.py Resolved
Comment thread aiosendspin/client/connection.py Resolved
Comment thread aiosendspin/client/connection.py Resolved
A server abort arriving while the hold-back cleared its gesture prompt
closed the window the operator had just opened, and a failing round
count query skipped releasing the pairing code out-channels.

Copilot AI 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.

🟢 Approval recommended

No active review issues block the change to enforce the dynamic pairing round limit.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@maximmaxim345
maximmaxim345 marked this pull request as ready for review November 17, 2026 16:17
@maximmaxim345
maximmaxim345 merged commit 756eb2d into main Nov 17, 2026
4 checks passed
@maximmaxim345
maximmaxim345 deleted the fix/reset-pairing-round-count branch November 17, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants