Fix authentication provider cleanup when an extension host stops #345127
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.63) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 302 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.342
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #345127"
general
weight: 0.35
wozhenbang2004
Related to #343316.
Authentication providers can remain in
AuthenticationServiceafter their owningMainThreadAuthenticationcustomer is disposed, leaving discovery to reuse a provider backed by the old RPC proxy. The customer already is disposed when its extension host stops; the missing cleanup is the service's independent provider registration.Provider deregistration now belongs to the registration's disposer, so both explicit unregistration and customer disposal use the same cleanup. External unregistration also releases the local registration, and cleanup suppresses only the owning host's unregister echo.
The focused regression tests check that disposal deregisters the provider without additional client-registration writes. The
RPCProtocoltest models the manager's teardown order, verifies cancellation through the old proxy, and checks that a fresh host can register with the same authentication service. Three additional tests cover explicit unregistration, external unregistration followed by registration on another host and teardown of the old host, and notifications to surviving hosts.Earlier validation for
ecaef8a5b708092acb0dff35fc8ea3323aa81d5fpassed in this isolated fork run: changed-file hygiene and ESLint, full client typecheck/transpilation, and the official Electron suites (12MainThreadAuthenticationtests and 24AuthenticationServicetests, plus one clean-state harness check per invocation; JUnit totals 13 and 25, no failures/errors/skips).The same RPC regression was then run with only the production
mainThreadAuthentication.tsreplaced by its unpatched version fromcd2259bdf72ec7421e70ae80999ceb46f8bd86fe. It failed at provider discovery: actualdynamic-provider, expectedundefined, after the real cancellation assertion had passed. Logs and JUnit artifact. The validation workflow stays on a separate fork branch, not in this PR.This establishes the component-level lifecycle defect, not the original live Datadog OAuth/Add Folder to Workspace scenario. I have not reproduced that end-to-end flow or confirmed this resolves all of #343316.
The official Electron suites and client typecheck have not been rerun for revision
e5886065e6ebcff0e1a712c49407c23233b71b61.