ruckus / quickbooks-ruby

Quickbooks Online REST API V3 - Ruby
MIT License
374 stars 302 forks source link

Service::AccessToken#disconnect causes ArgumentError (wrong number of arguments (given 4, expected 3)) #587

Closed JeremyC-za closed 1 year ago

JeremyC-za commented 1 year ago

Hey, as the title says, calling Service::AccessToken#disconnect results in an exception.

This only happens in in the 2.0 release, it works as expected in 1.0.21. The error seems to come from Faraday, which has me looking at this recent commit.

Here's the full trace:

faraday (1.10.2) lib/faraday/request/authorization.rb:48:in `initialize'
faraday (1.10.2) lib/faraday/dependency_loader.rb:21:in `new'
faraday (1.10.2) lib/faraday/dependency_loader.rb:21:in `new'
faraday (1.10.2) lib/faraday/rack_builder.rb:57:in `build'
faraday (1.10.2) lib/faraday/rack_builder.rb:175:in `block in to_app'
faraday (1.10.2) lib/faraday/rack_builder.rb:174:in `each'
faraday (1.10.2) lib/faraday/rack_builder.rb:174:in `inject'
faraday (1.10.2) lib/faraday/rack_builder.rb:174:in `to_app'
faraday (1.10.2) lib/faraday/rack_builder.rb:167:in `app'
faraday (1.10.2) lib/faraday/rack_builder.rb:154:in `build_response'
faraday (1.10.2) lib/faraday/connection.rb:516:in `run_request'
faraday (1.10.2) lib/faraday/connection.rb:283:in `post'
quickbooks-ruby (2.0) lib/quickbooks/service/access_token.rb:29:in `disconnect'
Lauren-penner commented 1 year ago

Faraday is not being forced above 1.x. If you are not ready to upgrade to Faraday 2.x you could overwrite the disconnect method to use the old authentication helper method basic_auth. f.basic_auth(oauth.client.id, oauth.client.secret)

jaredmoody commented 1 year ago

Monkey patching the gem is a workaround, but not a solution. If the gem isn't going to require Faraday 2.x, then it should handle using both instead of erroring when using an allowed dependency.

ashkulz commented 1 year ago

@JeremyC-za this has been fixed in the 2.0.1 release :+1: