Closed davidstosik closed 4 years ago
@davidstosik Thank you for the detailed bug report. I am able to reproduce it by following your steps.
What's interesting is that we have an unit test for this exact scenario, which is passing (/spec/webdrivers/chromedriver_spec.rb:109
). I haven't looked at the caching related code in a while, so I'll try to make time this weekend to debug this issue. However, a PR to fix this from you or anyone else is always welcome!
@davidstosik I have updated the specs to catch this bug and also have a possible fix that passes the test you shared:
$ bin/console
irb(main):001:0> `cat "C:/Users/Lakshya Kapoor/.webdrivers/chromedriver.version"`
=> "81.0.4044.138"
irb(main):002:0> File.mtime "C:/Users/Lakshya Kapoor/.webdrivers/chromedriver.version"
=> 2020-05-24 19:20:10 -0700
irb(main):003:0> %i(latest_version chrome_version current_version required_version).each{ |m| puts Webdrivers::Chromedriver.send(m) }
83.0.4103.39 # latest driver version
83.0.4103.61 # my Chrome version
81.0.4044.138 # current driver version
0 # required version
=> [:latest_version, :chrome_version, :current_version, :required_version]
irb(main):004:0> Webdrivers::Chromedriver.update
=> "C:/Users/Lakshya Kapoor/.webdrivers/chromedriver.exe"
irb(main):005:0> `cat "C:/Users/Lakshya Kapoor/.webdrivers/chromedriver.version"`
=> "83.0.4103.39"
irb(main):006:0> File.mtime "C:/Users/Lakshya Kapoor/.webdrivers/chromedriver.version"
=> 2020-05-24 19:21:34 -0700
As you can see, the default cache timeout value of 24 hours was ignored and the latest compatible driver version for Chrome 83.0.4103 was downloaded. I'll push the fix to master
once I'm done testing it locally.
@davidstosik I just pushed the fix (564907d71a3969ad8bc9c50485a3c1c37ae13aa6) to master
. And the specs were updated in fcea4dc29f023fe9335b101e526699d659798850. Would you mind loading the gem from the master branch and running through some tests of your own? Just want to get another set of eyes on the fix before I release it.
If everything looks good, I'll try to push out a patch release within this week.
v4.4.0 has been released with this fix.
Summary
From the README:
I've just experienced a scenario where that did not happen.
Debug Info
Please provide the following information for bug reports:
Here's all the debugging data I have:
Chrome version:
I have a hunch the
~/.webdrivers/chromedriver.version
cache file was created within the last 24 hours, but cannot confirm that, as it was deleted in order to fix the problem.Expected Behavior
Having Chrome 83.* running, while
chromediver
is at version 81.*, I would expect, as mentioned in the README, that the version number cache would be ignored, andchromedriver
updated to its latest version 83.*, "to make sure [I'm] using a compatible version".Actual Behavior
The following error is raised:
Deleting
~/.webdrivers/chromedriver.version
fixed the issue.