-
Notifications
You must be signed in to change notification settings - Fork 436
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
Register Faraday adapter #582
base: master
Are you sure you want to change the base?
Register Faraday adapter #582
Conversation
I've added another commit to this (a9d1dc0), to remove the remove_method calls. If my understanding is right, you were essentially "extending" Faradays bundled adapter and so removing these was important. Now it's been removed you should not need to remove any methods. I'm running the full faraday test suite against this adapter (lostisland/faraday#745) and it seems to work just fine when I comment out these lines. |
lib/typhoeus/adapters/faraday.rb
Outdated
@@ -25,7 +25,6 @@ class Typhoeus < Faraday::Adapter | |||
remove_method :setup_parallel_manager if method_defined? :setup_parallel_manager | |||
end | |||
|
|||
remove_method :call if method_defined? :call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this line removed typhoeus seems to continue to work just fine according to lostisland/faraday#745, and it seems to pass locally with v0.9 - v0.13. I cannot understand why it caused a problem, and I worry about removing it. Any ideas?
Plans have changed on the Farday side, and outright removal looks like it will not happen in 0.14 to ensure typhoeus users are not forced to upgrade. lostisland/faraday#745 (comment) |
Here is the reason for the exception: class Test < Faraday::Adapter
def test
return self.class.method_defined?(:call)
end
end
Test.new.test #=> true Apparently, |
@philsturgeon thanks a lot for your work! I don't know a lot about faraday and I would love to improve our adapter. right now the specs are failing. I would be happy to merge your PR once you let me know! ❤️ |
This PR will no longer be necessary once @iMacTia has merged lostisland/faraday#748, it should keep both gems compatible with each other. We can ensure that with #583 though. :) |
It would still be good to have these changes in so that we'll be able to get rid of the internal adapter once and for all in v1.0! @philsturgeon can you please add them to #583? |
Faraday has removed the Typhoeus adapter from master, so it'll be gone in v0.14 (as yet unreleased). Your adapter is fantastic, but without this line it'll stop working as its no longer regitered.
Faraday does not seem to care about having something registered twice, which is nice. |
Luck is on our side for once 😅 |
I've removed the 2nd commit, this one literally just registers the adapter in case faraday hasn't done it already; future proofing this for the change ahead. |
sadly the test suite is failing due to this:
No idea whats happening there. |
👋 @philsturgeon, I appreciate it's been a while. Is this PR still relevant and if it is, how can we get it merged? |
I'm attempting to upgrade all the gems in our app, and now running into |
@woahdae which combination of The reason why this works in However that file was ultimately removed in Faraday 2.0, potentially causing the issue again |
I got it to work via the
At a quick glance it appears to be the built in adapter without the |
Good catch @woahdae, I completely forgot about the new adapter! I guess your point on updating the Typhoeus documentation would make sense: we should clarify that the built-in adapter will work up until faraday 1.x, but if you're running faraday 2.x then you'll need to use the external adapter above☝️. @PericlesTheo I'd love to hear your thoughts on this, but here is my suggestion:
|
Thank you @dleavitt 🙏, I'd suggest waiting to hear from the |
Faraday has removed the Typhoeus adapter from master (lostisland/faraday#715), so it'll be gone in v0.14 (as yet unreleased). Your adapter is fantastic, but without this line it'll stop working as its no longer registered.