[grid][java]: apply protocol version in relay session factory
User description
Thanks for contributing to Selenium! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines. Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
A missing in part of last PR #13849 for a workaround in the relay node with Appium
To ensure the fix works, I set up an end2end test where able to execute and verify the session can be created successfully based on the dev package built locally. Result as below

Tested TOML
[server]
port = 5556
[node]
detect-drivers = false
[relay]
url = "http://localhost:4723"
status-endpoint = "/status"
protocol-version = "HTTP/1.1"
configs = [
'1', '{"platformName": "android", "appium:platformVersion": "14", "appium:deviceName": "emulator-5554", "appium:automationName": "uiautomator2", "appium:browserName": "chrome", "browserName": "chrome"}'
]
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
Type
Bug fix
Description
- The PR addresses an issue where the
serviceProtocolVersionwas not being applied to theclientConfiginRelaySessionFactory. - This change ensures that if
serviceProtocolVersionis provided, it is set in theclientConfigwhich is used to create a new session.
Changes walkthrough
| Relevant files | |||
|---|---|---|---|
| Enhancement |
|
✨ PR-Agent usage: Comment
/helpon the PR to get a list of all available PR-Agent tools and their descriptions
PR Description updated to latest commit (https://github.com/SeleniumHQ/selenium/commit/eed2f818b3557c5f3250a8092e2bb39f9c0dec4e)
- [ ] Copy walkthrough table to "Files Changed" Tab
PR Review
| ⏱️ Estimated effort to review [1-5] |
2, because the changes are localized and straightforward, involving only a conditional addition of a protocol version to the client configuration. The logic is simple and the impact is limited to a specific part of the code. |
| 🧪 Relevant tests |
No |
| 🔍 Possible issues |
Possible Bug: The check for |
| 🔒 Security concerns |
No |
✨ Review tool usage guide:
Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.
The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
- When commenting, to edit configurations related to the review tool (
pr_reviewersection), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
- With a configuration file, use the following template:
[pr_reviewer]
some_config1=...
some_config2=...
See the review usage page for a comprehensive guide on using this tool.
PR Code Suggestions
| Category | Suggestions |
| Best practice |
Use a local variable for the modified client configuration to ensure thread safety.To ensure thread safety and immutability, consider using a local variable for the modified java/src/org/openqa/selenium/grid/node/relay/RelaySessionFactory.java [162-164]
|
✨ Improve tool usage guide:
Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.
- When commenting, to edit configurations related to the improve tool (
pr_code_suggestionssection), use the following template:
/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
- With a configuration file, use the following template:
[pr_code_suggestions]
some_config1=...
some_config2=...
See the improve usage page for a comprehensive guide on using this tool.
I cannot update the fork because maintainers have no permission, this is missing
@diemol probably the fork in an org and something restricted that I can't remove. Anyhow, I just rebased the branch