facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
210 stars 159 forks source link

Update Faraday dependency to 2.x #184

Closed multiplegeorges closed 1 year ago

multiplegeorges commented 2 years ago

Which SDK version are you using?

0.14.0.0

What's the issue?

The Faraday connection created here does not specify a timeout or a way to configure a timeout on the request.

The gemspec requires an old version of Faraday. With version 1.x of Faraday, we can't pass options to the adapters. With version 2+ of Faraday, we can pass options to the adapters using Faraday.default_adapter_options. This would allow users to specify their own timeout configuration.

Steps/Sample code to reproduce the issue

require "http"
require "faraday"

Faraday.default_adapter = :http
Faraday.default_adapter_options = {timeout: 11}

Observed Results:

.../faraday-1.10.2/lib/faraday.rb:182:in `method_missing': undefined method `default_adapter_options=' for Faraday:Module (NoMethodError)

Expected Results:

If this gem would upgrade the Faraday gem, this would work.

Zajn commented 2 years ago

I opened https://github.com/facebook/facebook-ruby-business-sdk/pull/186 to hopefully get this bump to Faraday merged!

olleolleolle commented 1 year ago

Right, and this was addressed in https://github.com/facebook/facebook-ruby-business-sdk/commit/07f76898ddee14b6407774093e6121a340629ba1