Repository navigation
Conversation
[bot] 🏷 PR #7349 review — retire upstream dispatchers on CA identity change I reviewed this independently (re-derived the bug, ran the suites, read the diff — not from the issue's conclusions). The bug is real and reproduced. On the PR base ( The fix is correct and complete. Both dispatcher caches ( No regressions. Audited the existing behaviors the touched paths carry:
Tests have teeth. They read the real undici Verification I ran locally (targeted, per repo discipline):
Diff is clean (2 src files +15/-2 each, 1 new test file +192; no unrelated changes, no whitespace churn). Code follows the file's existing patterns — the close logic is extracted into Verdict: ready to merge (CI green, bug reproduced + fixed, no regressions). Merge is human-only per repo rules. 结构化八问(供人工 reviewer):
|
Problem
Both outbound dispatcher caches key entries by the configured CA identity but never remove older identities. Repeated CA changes retain obsolete direct Agents and ProxyAgents, their trust material and origin pools for the process lifetime.
Changes
When the effective CA identity changes, gracefully close and clear the prior identity's cached dispatchers. Both direct and proxied paths continue reusing the current identity across their existing timeout/route variants. The existing
close()cleanup waits for in-flight responses; it does not destroy their streams.The trust construction, CA identity refresh policy, default timeouts, wire payload and configuration surface are unchanged.
Verification
1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3(currentmaster, 0.1.216).npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graph, andgit diff --check: passed.c2ccc1e28f69bd345876a1fa0257493b677ee7a0exactly matches the local validated tree.Related #3786, #6096 and #7004 handle CA configuration, identity refresh and trust merging. This addresses the remaining cache lifecycle defect in both transport paths as one change.
Fixes #7348