You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bcf6b77
Browse filesBrowse the repository at this point in the historyBrowse files
fix(upstream): make the PendingAuth park reachable and stop the token-scan redial loop
Cross-model review of the previous commit surfaced four defects, three of them
in code it newly depended on:
- `IsOAuthPending` type-asserted instead of unwrapping, but the deferred-OAuth
error is wrapped twice on its way out of Connect ("all authentication
strategies failed, last error: %w" then "failed to connect: %w"). The check
never fired in production, so the park — and every consumer keyed to it — was
unreachable. Now `errors.As`, with the production wrapping shape pinned in a
test.
- `Manager.scanForNewTokens` triggered a reconnect whenever *any* persisted
token existed. A failing server usually still holds the expired/revoked token
it just failed with, so the 5s scan redialed it every pass (rate-limited only
to 10s/server) — a tighter loop than the supervisor's and one that walks
straight through the park. It now records a fingerprint of the token it
retried with and fires only when a login or refresh writes a different one.
- `ConnectAll` gated on `StateError && !ShouldRetry()`, so a config reload
redialed parked and OAuth-backed-off servers. It now consults the same
`ShouldAutoReconnect` policy as the supervisor. A config change for the
server itself still reconnects it via ActionReconnect.
- `SetPendingAuth` dispatched its state-change callback detached, which can be
scheduled after a later Connecting/Ready callback and surface a stale
"sign in required" prompt right after a successful login. It is synchronous
now, matching the TransitionTo that used to deliver this state.
Also replaces the reconcile test's fixed sleeps with an actionWg barrier so the
negative assertions cannot pass before an erroneous redial would have run.
Refs #1013, #1014
0 commit comments