Skip to content
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

Address Faraday::Connection#authorization deprecation warning #93

Merged
merged 1 commit into from
Feb 27, 2022
Merged

Address Faraday::Connection#authorization deprecation warning #93

merged 1 commit into from
Feb 27, 2022

Conversation

nsmmrs
Copy link
Contributor

@nsmmrs nsmmrs commented Nov 6, 2021

Fixes #89:

WARNING: `Faraday::Connection#authorization` is deprecated; it will be removed in version 2.0.
While initializing your connection, use `#request(:authorization, ...)` instead.
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.

The tests pass, but I've never touched Faraday or VCR before, so I'm sure a sanity check is in order.

It may be worth noting that when I remove the list_folder_longpoll VCR fixtures and re-run the tests, I do get this one failure:

Failures:

  1) DropboxApi::Client#list_folder_longpoll indicates if there're changes
     Failure/Error: expect(result.changes).to be_truthy

       expected: truthy value
            got: false
     # ./spec/endpoints/files/list_folder_longpoll_spec.rb:22:in `block (2 levels) in <top (required)>'
     # ./spec/support/vcr.rb:36:in `block (3 levels) in <top (required)>'
     # ./spec/support/vcr.rb:36:in `block (2 levels) in <top (required)>'

Finished in 54.28 seconds (files took 0.93252 seconds to load)
210 examples, 1 failure

Failed examples:

rspec ./spec/endpoints/files/list_folder_longpoll_spec.rb:19 # DropboxApi::Client#list_folder_longpoll indicates if there're changes

@@ -3,7 +3,7 @@ module DropboxApi::Endpoints
class RpcNotify < DropboxApi::Endpoints::Rpc
def build_connection
@connection = @builder.build('https://notify.dropboxapi.com') do |c|
c.headers.delete 'Authorization'
c.builder.handlers.delete(Faraday::Request::Authorization)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the documented way to remove existing handlers: https://www.rubydoc.info/gems/faraday/Faraday/RackBuilder#delete-instance_method

@rainerborene
Copy link

@Jesus could you please merge this PR and release a new version?

@Jesus
Copy link
Owner

Jesus commented Feb 27, 2022

Thanks for flagging the problem with the list_folder/longpoll endpoint, it was a bug in the tests and have been fixed in 3cd0c32. Totally unrelated to your changes.

@Jesus Jesus merged commit bb07ed8 into Jesus:master Feb 27, 2022
@nsmmrs nsmmrs deleted the faraday-fix branch February 27, 2022 21:02
@rainerborene
Copy link

@Jesus did you release a new version on Rubygems? If not, please do so. Thanks, dude :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WARNING: Faraday::Connection#authorization
3 participants