Closed titusfortner closed 1 month ago
โฑ๏ธ Estimated effort to review [1-5] | 3, because the PR involves changes across multiple files and classes, including architectural changes that shift responsibilities from one class to another. Understanding the impact of these changes on the system's behavior and ensuring that all dependencies and interactions are correctly handled requires a moderate level of effort. |
๐งช Relevant tests | No |
โก Possible issues | Possible Bug: The removal of BiDi instance management from the `driver.rb` and its addition to `bridge.rb` could potentially lead to issues if not all references and dependencies were updated accordingly. For example, any method that previously depended on `@bidi` being initialized directly in the `Driver` class might fail if it hasn't been updated to use the bridge's BiDi instance. |
Error Handling: The new error message in `bridge.rb` for BiDi operations when `web_socket_url` is not set might not be clear enough for end users or might not cover all scenarios where the error could occur. | |
๐ Security concerns | No |
Category | Suggestion | Score |
Possible issue |
Ensure
___
**To ensure that the | 8 |
Safeguard against uninitialized
___
**To avoid potential issues with uninitialized variables, ensure that | 7 | |
Safeguard against uninitialized
___
**To ensure that the | 7 | |
Safeguard against uninitialized
___
**To ensure that the | 7 |
**Action:** Ruby / Unit Tests (3.0.6, macos) / Unit Tests (3.0.6, macos) |
**Failed stage:** [Run Bazel](https://github.com/SeleniumHQ/selenium/actions/runs/9357676529/job/25758221563) [โ] |
**Failed test name:** Selenium::WebDriver::Remote::Bridge#quit |
**Failure summary:**
The action failed due to two issues:Selenium::WebDriver::Remote::Bridge#quit failed because it raised a NoMethodError . The method quit attempted to call close on a nil object.//rb/spec/unit/selenium:server timed out after 1800 seconds. |
Relevant error logs:```yaml 1: ##[group]Operating System 2: macOS ... 684: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning renaming duplicate member name 'map_field.o' from 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/0/map_field.o(map_field.o)' and 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/1/map_field.o(map_field.o)' 685: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning renaming duplicate member name 'message.o' from 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/1/message.o(message.o)' and 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/0/message.o(message.o)' 686: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning renaming duplicate member name 'message_field.o' from 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/0/message_field.o(message_field.o)' and 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/1/message_field.o(message_field.o)' 687: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning renaming duplicate member name 'primitive_field.o' from 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/1/primitive_field.o(primitive_field.o)' and 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/0/primitive_field.o(primitive_field.o)' 688: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning renaming duplicate member name 'service.o' from 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/0/service.o(service.o)' and 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/1/service.o(service.o)' 689: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning renaming duplicate member name 'string_field.o' from 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/0/string_field.o(string_field.o)' and 'bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protoc_lib/1/string_field.o(string_field.o)' 690: [32m[1,005 / 1,849][0m Creating source manifest for //rb/spec/unit/selenium/webdriver/firefox:profile; 0s local ... (3 actions, 1 running) 691: [32mINFO: [0mFrom Linking external/protobuf~/libprotobuf.a [for tool]: 692: /Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: bazel-out/darwin_x86_64-opt-exec-ST-13d3ddad9198/bin/external/protobuf~/_objs/protobuf/error_listener.o has no symbols ... 886: [32mINFO: [0mFrom Testing //rb/spec/unit/selenium/webdriver/remote:bridge: 887: |
Actually, the AI has good suggestions to fix.
RubyMine insisted I could remove the &.
operations in a few places and I don't think it is correct.
User description
Description
Moves implementation of bidi away from the driver class and onto the bridge class Should be a non-breaking change
Motivation and Context
Classes that use BiDi should be initialized by a bridge instance not the driver instance.
I think we probably want to implement the conversion of WebDriver Classic to WebDriver BiDi as a separate Bridge, and this should make that easier.
PR Type
enhancement
Description
quit
andclose
methods in the driver class to remove BiDi handling.quit
andclose
methods.Changes walkthrough ๐
driver.rb
Remove BiDi instance management from driver class
rb/lib/selenium/webdriver/common/driver.rb
quit
andclose
methods to remove BiDi handling.has_bidi.rb
Delegate BiDi instance management to bridge
rb/lib/selenium/webdriver/common/driver_extensions/has_bidi.rb - Updated `bidi` method to delegate to the bridge.
bridge.rb
Add BiDi instance management to bridge class
rb/lib/selenium/webdriver/remote/bridge.rb
quit
andclose
methods to handle BiDi instance.driver.rbs
Remove BiDi instance variable from driver signature
rb/sig/lib/selenium/webdriver/common/driver.rbs - Removed BiDi instance variable declaration.
bridge.rbs
Add BiDi instance variable to bridge signature
rb/sig/lib/selenium/webdriver/remote/bridge.rbs - Added BiDi instance variable declaration.