-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Ferrum::Network::Response#loaded?
fails on 302
redirects after #309
#321
Comments
Oh I see, could you please try to add check for a redirect status here, something like: def subscribe_response_received
@page.on("Network.responseReceived") do |params|
exchange = select(params["requestId"]).last
if exchange
response = Network::Response.new(@page, params)
exchange.response = response
response.loaded = true if response.status is redirect # <<< HERE
end
end
end and tell me if it works? |
Thanks for the quick reply! def loaded?
if @loaded.nil?
puts params['request']['url'] if params['request']
puts params['redirectResponse']['status'] if params['redirectResponse']
end
@loaded
end Output
A little more debugging: def subscribe_response_received
@page.on("Network.responseReceived") do |params|
exchange = select(params["requestId"]).last
if exchange
response = Network::Response.new(@page, params)
exchange.response = response
puts "#{response.status} - #{response.url}"
binding.pry if response.status != 200
binding.pry if params['redirectResponse']['status'] == 302
response.loaded = true if response.status is redirect
end
end
end Output
|
@dmorgan-fa As you already worked on this, is the proposed fix in #328 making sense? |
@francisbeaudoin, sorry for the delayed response. |
Hi,
Firstly, thanks for the excellent work on this gem and Cuprite!
We've been looking into some reliability issues lately and trying different things. One thing that I've noticed, is a recent change:
now causes redirect requests to be considered still
pending
even though they've completed:Full Ferrum::Network::Exchange object here
This output was from a forked branch with some extra logging:
Admittedly this is only seen when we're calling Cuprite's
wait_for_network_idle
directly within a spec (something we're looking to remove), but it looks like something that will trip Ferrum up ifwait_for_idle
gets called and there's been a redirect.The text was updated successfully, but these errors were encountered: