Repository navigation
fix: use a dispatcher set with setGlobalDispatcher for driver downloads - #36
Merged
Merged
Conversation
7.x downloaded with Node's fetch, which uses the global dispatcher, and the WebdriverIO proxy docs suggest undici's setGlobalDispatcher. 8.x gave undici's fetch its own EnvHttpProxyAgent, so those downloads skipped the proxy. A custom global dispatcher now wins; else the proxy variables apply. It is read per request, because WebdriverIO sets it after the driver module has loaded. Also: findEdgePath() returns string | undefined in the edgedriver README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plum117
marked this pull request as ready for review
October 9, 2026 19:52
|
The tests stopped after the version lookup, so the archive request could lose the global dispatcher unseen. Each now serves valid metadata and an archive from a MockAgent with net connect disabled, and download() must succeed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The WebdriverIO proxy docs offer two ways to set a proxy: the
HTTPS_PROXY/HTTP_PROXY/NO_PROXYvariables, or undici'ssetGlobalDispatcherinwdio.conf.js("Option 2", for custom authentication and similar). WebdriverIO's own requests use a custom global dispatcher.edgedriver 7.x and geckodriver 7.x downloaded with Node's built-in
fetch, which uses that global dispatcher. After #29, 8.x gives undici'sfetchits ownEnvHttpProxyAgent, so the global dispatcher is ignored. A user with Option 2 and no proxy variables would download the drivers directly, and in a closed corporate network the download would fail. This change was not released yet.Checked with a local proxy and
setGlobalDispatcher(new ProxyAgent(…)), and no proxy variables:mainChange
Agentwins (the same check aswebdriver'sgetDispatcher()). Else theEnvHttpProxyAgentreads the proxy variables, as before.wdio.conf.js.findEdgePath()asstring | undefined(it returnsundefinedwhen Edge is not installed).Test plan
tests/globalDispatcher.test.tsin edgedriver and geckodriver: set aMockAgentwithdisableNetConnect()after the module loaded. Red onmain(the requests reached the real network); green with the fixe2eproxy.e2e.test.ts(proxy variables, local CONNECT proxy): 3 passed🤖 Generated with Claude Code