Skip to content

restore BiDi constructor without timeout parameter#17014

Merged
asolntsev merged 1 commit into
SeleniumHQ:trunkfrom
asolntsev:restore-bidi-constructor
Jan 27, 2026
Merged

restore BiDi constructor without timeout parameter#17014
asolntsev merged 1 commit into
SeleniumHQ:trunkfrom
asolntsev:restore-bidi-constructor

Conversation

@asolntsev

@asolntsev asolntsev commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

This constructor has been used in Appium (not anymore), and probably some other projects. Let it stay deprecated until Selenium 5.0

🔗 Related Issues

appium/java-client#2383

🔧 Implementation Notes

We will need to remove this constructor after few released. Maybe in Selenium 5.0

💡 Additional Considerations

In Appium, it's not needed anymore (after appium/java-client#2383 has been merged).
But just in case, let's keep this constructor for a while - probably it makes somebody's life easier.

🔄 Types of changes

  • Bug fix (backwards compatible)

This constructor has been used in Appium (not anymore), and probably some other projects. Let it stay deprecated until Selenium 5.0
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Type

Enhancement


Description

  • Restore deprecated BiDi constructor without timeout parameter

  • Delegates to constructor with 30-second default timeout

  • Maintains backwards compatibility for external projects

  • Marked for removal in Selenium 5.0


File Walkthrough

Relevant files
Enhancement
BiDi.java
Add deprecated BiDi constructor without timeout                   

java/src/org/openqa/selenium/bidi/BiDi.java

  • Added overloaded constructor accepting only Connection parameter
  • New constructor delegates to existing constructor with 30-second
    default timeout
  • Marked with @Deprecated(forRemoval = true) annotation
  • Includes Javadoc referencing the preferred constructor with timeout
+8/-0     

@selenium-ci selenium-ci added C-java Java Bindings B-devtools Includes everything BiDi or Chrome DevTools related labels Jan 27, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@asolntsev asolntsev added this to the 4.41.0 milestone Jan 27, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Replace magic number with a constant

Replace the hardcoded default timeout value of 30 with a named constant to
improve code readability and maintainability.

java/src/org/openqa/selenium/bidi/BiDi.java [38]

-this(connection, Duration.ofSeconds(30));
+// At class level
+private static final Duration DEFAULT_BIDI_TIMEOUT = Duration.ofSeconds(30);
 
+// In the constructor
+this(connection, DEFAULT_BIDI_TIMEOUT);
+

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies a magic number and proposes replacing it with a named constant, which improves code readability and maintainability.

Low
  • More

@asolntsev asolntsev self-assigned this Jan 27, 2026
@asolntsev asolntsev merged commit 0f71ed6 into SeleniumHQ:trunk Jan 27, 2026
51 checks passed
@asolntsev asolntsev deleted the restore-bidi-constructor branch January 27, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-devtools Includes everything BiDi or Chrome DevTools related C-java Java Bindings Review effort 1/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants