Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minBrowserVersion in SyncOption should be a number #291

Merged
merged 5 commits into from
Mar 14, 2023

Conversation

rerorero
Copy link
Contributor

@rerorero rerorero commented Mar 13, 2023

Issue to fix

This PR fixes an issue where selectMatchingDrivers() ignores minBroswerVersion and attempts to download a lot of unnecessary ChromeDrviers.

Here is a log. While it can detect the Chrome version, it doesn't filter with the minimum browser version.

...... (At Line 12996)
2023-03-12 08:12:37:097 - [debug] [Chromedriver@558d] [Chromedriver@558d] Browser version in the supplied details: Chrome/66.0.3359.158
2023-03-12 08:12:37:097 - [debug] [Chromedriver@558d] [Chromedriver@558d] Found Chrome bundle 'undefined' version '66.0.3359'
...
... (At Line 16182)
2023-03-12 08:12:41:829 - [debug] [ChromedriverStorageClient] [ChromedriverStorageClient] Selecting chromedrivers whose platform matches to mac64
2023-03-12 08:12:41:831 - [debug] [ChromedriverStorageClient] [ChromedriverStorageClient] Got 121 items
...

Cause

selectMatchingDrivers() assumes minBrowserVersion is a string but it's always a number as it's given here and the type of Semver.chromeVersion.major is number. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/semver/classes/semver.d.ts#L12

@rerorero rerorero marked this pull request as ready for review March 13, 2023 01:51
lib/utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
@mykola-mokhnach
Copy link
Contributor

It looks like unit tests need some update

@rerorero
Copy link
Contributor Author

rerorero commented Mar 14, 2023

Thank you for reviews, I'll take a look at CI not working too.

@rerorero
Copy link
Contributor Author

I fixed the points according to your comments, PTAL
And I found the CI issue doesn't relate to this change. So I opened a new PR, please also take a look. Thank you.
#292

function convertToInt(value) {
switch (typeof value) {
case 'number':
return Number.isNaN(value) ? null : value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might also return floats, but that is probably not something we care much

@mykola-mokhnach mykola-mokhnach merged commit 39d8fdd into appium:master Mar 14, 2023
github-actions bot pushed a commit that referenced this pull request Mar 16, 2023
## [5.3.1](v5.3.0...v5.3.1) (2023-03-16)

### Bug Fixes

* install-npm.js fails to run npm run build due to type error ([#292](#292)) ([1e3014b](1e3014b))
* minBrowserVersion in SyncOption should be a number ([#291](#291)) ([39d8fdd](39d8fdd))

### Miscellaneous Chores

* ChromeDriver Bump to v111.0.5563.64 ([#290](#290)) ([2c4c144](2c4c144))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants