You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR removes the '-exclusive-if-local' tag filter from remote tests. This might allow tests that should only run locally to be executed in remote environments, potentially causing unexpected failures.
The delete_cookie method now converts the name parameter to a string using to_s, but it doesn't pass the converted string to the execute method. This could cause issues when a symbol is passed as the cookie name.
def delete_cookie(name)
raise ArgumentError, 'Cookie name cannot be null or empty' if name.nil? || name.to_s.strip.empty?
- execute :delete_cookie, name: name+ execute :delete_cookie, name: name.to_s
end
Apply this suggestion
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a critical inconsistency in the PR. While the validation logic was updated to handle symbol names with to_s, the actual parameter passed to execute wasn't updated, which would cause issues when symbols are used as cookie names (as shown in the new test case).
High
Learned best practice
Ensure consistent type handling by converting parameters to the expected type before use
The current implementation calls to_s on name in the validation check but doesn't ensure the same conversion when passing the name to execute. This could lead to inconsistent behavior when symbols are passed as cookie names. Ensure the name is consistently converted to string before using it.
def delete_cookie(name)
raise ArgumentError, 'Cookie name cannot be null or empty' if name.nil? || name.to_s.strip.empty?
-- execute :delete_cookie, name: name++ execute :delete_cookie, name: name.to_s
end
Apply this suggestion
Suggestion importance[1-10]: 6
Low
Update
aguspe
changed the title
Rb delete cookie issue
[rb] Allow symbols again to be passed on delete_cookie
Mar 26, 2025
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
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.
User description
Motivation and Context
Regarding the issue raised on #15386 by Akarzim deleting a cookie as a symbol fails
This PR adds support for symbols by converting the value to a string on the conditional check
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Fixed bug when deleting cookies with symbol names.
Updated
delete_cookiemethod to handle symbols correctly.Added test case for deleting cookies using symbols.
Modified Bazel configuration for remote test tag filters.
Changes walkthrough 📝
bridge.rb
Fix symbol handling in `delete_cookie` methodrb/lib/selenium/webdriver/remote/bridge.rb
delete_cookiemethod to convert symbol names to strings.manager_spec.rb
Add test for deleting cookies with symbolsrb/spec/integration/selenium/webdriver/manager_spec.rb
.bazelrc.remote
Update Bazel remote test tag filters.bazelrc.remote
exclusive-if-local.