fix: stop aggressive retry on auth failures, show setup nudge#206
Merged
shanselman merged 1 commit intomasterfrom Apr 23, 2026
Merged
fix: stop aggressive retry on auth failures, show setup nudge#206shanselman merged 1 commit intomasterfrom
shanselman merged 1 commit intomasterfrom
Conversation
Part 1 (fixes #198): Move reconnect attempt counter reset from TCP connect to application-level hello-ok handshake. Auth failures now properly progress through backoff (1s→2s→4s→8s→15s→30s→60s) instead of resetting to 1s on every attempt. Part 2 (closes #199): Detect terminal auth errors (token mismatch, origin not allowed, rate limited, signature exhausted) and stop retrying entirely. Fire AuthenticationFailed event so the UI shows a setup nudge in the tray menu. Security: exhausted device signature modes (all 4 rejected) are now treated as terminal — no infinite cycling. Error messages stay local (log file + tray menu only, never sent externally). Pairing success already sends a toast notification (Toast_NodePaired) in all 5 locales.
4f26c17 to
ae88d03
Compare
github-actions Bot
added a commit
that referenced
this pull request
Apr 24, 2026
Tests for the auth-failure backoff and terminal error detection added in PR #206 (fix: stop aggressive retry on auth failures): - HandleRequestError_TerminalAuthError_SetsAuthFailedFlag (theory): token mismatch / origin not allowed / too many failed → _authFailed set - HandleRequestError_TerminalAuthError_RaisesAuthenticationFailedEvent: AuthenticationFailed event fired with message text - HandleRequestError_TerminalAuthError_RaisesErrorStatus: ConnectionStatus.Error raised on terminal auth error - HandleRequestError_TerminalAuthError_OnNonConnectMethod_DoesNotSetAuthFailed: terminal-auth guard is scoped to 'connect' method only - HandleHelloOk_AfterAuthFailed_ClearsAuthFailedFlag: hello-ok response resets the flag so reconnect is re-enabled - HandleRequestError_AllDeviceSignatureModesExhausted_SetsAuthFailed: cycling through all 4 signature modes fires AuthenticationFailed once 660 Shared pass (+8), 20 skipped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 24, 2026
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.
Fixes two related issues:
#198 — Aggressive retry loop: The reconnect counter was reset to 0 on every TCP connect, so auth failures (token mismatch, origin rejected) never progressed past 1-second backoff. Now resets only on successful hello-ok handshake.
#199 — Setup nudge: Terminal auth errors (token mismatch, origin not allowed, rate limited) now stop retrying entirely and show '⚠️ Auth failed — Run Setup' in the tray menu, linking directly to the Setup Wizard.
4 files, +54/-2. All 794 tests pass.
Fixes #198
Closes #199