-
Notifications
You must be signed in to change notification settings - Fork 981
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
Use external multipart and retry middleware #1367
Conversation
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.
👍 Getting rid of a 1000+ lines from this codebase is also very nice.
Also: Yes to the Ruby version support change.
I upgraded to Faraday v1.8 and implemented something new to use Reviewing this, I remember now about the work around moving parts into external gems. If I understand right, would it be expected that I just have to now use |
@javierjulio those are the correct classes to use from now on, but the old one should have worked just the same! That was a regression in the first "standalone" version of Could you try to check which version of the middleware you're using and if upgrading to the latest fixes the issue? |
Thank you! In the meantime I'll make that update to use the Yes I can. I've confirmed the - faraday (1.8.0)
+ faraday (1.9.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
- faraday-httpclient (~> 1.0.1)
+ faraday-httpclient (~> 1.0)
+ faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
- faraday-net_http_persistent (~> 1.1)
+ faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
- multipart-post (>= 1.2, < 3)
+ faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
+ faraday-multipart (1.0.2)
+ multipart-post (>= 1.2, < 3)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
+ faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0) |
I just reviewed the code and it seems I missed |
@javierjulio That's done 🙌. Once again feedback welcome if the fix works 🙏 |
@iMacTia you're welcome! I just ran our test against the 1.0.3 release, without any of the changes I mentioned before, and it passed so its fixed. Thank you! To confirm, since we'd like to be ready for Faraday v2, we are now adding |
@javierjulio wonderful!
That's great 🙌! Just bear in mind that if you want to support both Faraday v1 and v2 you'll need a few conditionals in your code. I'm still trying to find the time to put a guide together, but in short that would be:
|
This commit limits compatible Faraday versions to versions between `0.9.0` and `1.8.x`. The recently released `1.9.x` series isn't compatible with some magic we have in `lib/restforce/file_part.rb` to maintain compatability with pre-1.0 versions - see lostisland/faraday#1367 for the relevant changes.
Description
Use external multipart and retry middleware.
It should allow external gems to support both Faraday v1 and v2
Additional notes
I had to bump Ruby min version to 2.6, but considering 2.6 is going EOL at the end of March, I guess that should be fine?