frontend: AuthChooser: Ignore stale authentication results #8885
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.60) × (1 − Review Confidence (0.44)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 225 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.324
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #8885"
general
weight: 0.35
illume
Summary
An authentication check can complete after a mounted
AuthChooserchanges context and still redirect to its old destination or update stale configuration. Give each check its own cancellation state and ignore superseded results.Manual reproduction (component-level)
Runnable browser demo and setup instructions. It uses the real
AuthChooser, Redux, React Router and HTTP auth check with a local API simulator.1. Check out this PR, install the frontend dependencies, and run the linked script in
authmode.2. Open Original and click Start Alpha, switch to Beta, release Alpha then Beta. This starts Alpha's auth check, changes the mounted component's cluster/return destination to Beta, then releases Alpha's delayed success. It incorrectly finishes at
/target/alpha.3. Open PR version and repeat. The log shows both probes; Alpha's obsolete completion is ignored and the final route is
/target/beta.The demo deliberately keeps
AuthChoosermounted. The full app'sLayout/RouteSwitcherkeys can remount it during navigation; a live-cluster reproduction through the full app has not been established. No real cluster/identity provider is used, and this does not demonstrate a token being accepted by the wrong cluster.Validation
Regressions also cover stale failure, pending logout and StrictMode replay. All 19 CI checks and EasyCLA pass. Related to #5401; this does not resolve the whole tracker or change authentication-error classification.
PR #8885 revision range. Code, tests, reproducer and description used AI assistance.