fix: keep user client config when switching to direct connect endpoint - #1291
Open
Dor-bl wants to merge 1 commit into
Open
fix: keep user client config when switching to direct connect endpoint#1291Dor-bl wants to merge 1 commit into
Dor-bl wants to merge 1 commit into
Conversation
When the server decorates the new session response with directConnect* capabilities, the client rebuilt its command executor out of the endpoint URL alone. That silently dropped all settings from the user-provided AppiumClientConfig, including read timeout, pool manager arguments, proxy, CA bundle, and authentication credentials, downgrading the config instance to a plain selenium ClientConfig. The most visible consequence was that configuring a read timeout had no effect on such sessions, allowing hanging server calls to never time out. Reuse a copy of the current configuration and update the endpoint URL instead. Copying preserves the original instance given by the user, while also avoiding the deprecated remote_server_addr/keep_alive arguments of RemoteConnection. Closes appium#855
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.
Description
When the Appium server decorates the new session response with
directConnect*capabilities, the client rebuilt its command executor out of the endpoint URL alone. That silently dropped every setting of theAppiumClientConfigsupplied by the user—includingtimeout,init_args_for_pool_manager, proxy, CA bundle, and authentication credentials—and downgraded the config instance to a default SeleniumClientConfig.The most visible consequence was that configuring a read timeout had no effect on sessions redirected via direct connect, causing requests to hang indefinitely if the endpoint became unresponsive.
This PR ensures the client reuses a copy of the existing
client_configand only replaces the endpoint URL (remote_server_addr). Copying ensures the user-provided instance remains unmodified, while also avoiding the deprecatedremote_server_addr/keep_aliveconstructor arguments ofRemoteConnection.Closes #855
Changes
appium/webdriver/webdriver.py: In_update_command_executor, copyself.command_executor.client_config, updateremote_server_addrandkeep_alive, and passclient_configtoAppiumConnection/RemoteConnection.test/unit/webdriver/webdriver_test.py: Addtest_create_session_register_uridirect_keeps_client_configverifying thattimeout,username,password,user_agent,init_args_for_pool_manager, anddirect_connectionpersist after direct connect endpoint update.README.md: Clarify that customclient_configparameters are retained across direct connect switches.