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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicated Faraday::Retry::Middleware: #1448

Merged
merged 1 commit into from
Jul 1, 2022

Conversation

Edouard-chin
Copy link
Contributor

馃憢 Hello, thanks for your work on maintaining Octokit 鉂わ笍 !

Remove duplicated Faraday::Retry::Middleware:

  • Problem

    The Faraday::Retry::Middleware is added twice by Octokit when
    instantiating the Faraday::RackBuilder object.

    irb(main):001:0> Octokit.middleware
    =>
    #<Faraday::RackBuilder:0x0000000107898700
      @adapter=Faraday::Adapter::NetHttp,
      @handlers=
      [Faraday::Retry::Middleware,
      Faraday::Retry::Middleware,
      ...

    Context

    The latest Faraday version in the 1.x serie added an alias
    for Faraday::Request::Retry
    https://github.com/lostisland/faraday/blob/824423ccbb534d0b0553c3a0b3f2fbb9b0d84c60/lib/faraday.rb#L33

    Solution

    Use a elsif statement to avoid ending up with duplicated middleware

- ### Problem

  The Faraday::Retry::Middleware is added twice by Octokit when
  instantiating the Faraday::RackBuilder object.

  ```sh
  irb(main):001:0> Octokit.middleware
  =>
  #<Faraday::RackBuilder:0x0000000107898700
    @adapter=Faraday::Adapter::NetHttp,
    @handlers=
    [Faraday::Retry::Middleware,
    Faraday::Retry::Middleware,
    ...
  ```

  ### Context

  The latest Faraday version in the 1.x serie added an alias
  for `Faraday::Request::Retry`
  https://github.com/lostisland/faraday/blob/824423ccbb534d0b0553c3a0b3f2fbb9b0d84c60/lib/faraday.rb#L33

  ### Solution

  Use a elsif statement to avoid ending up with duplicated middleware
@timrogers timrogers merged commit f06f830 into octokit:4-stable Jul 1, 2022
@Edouard-chin Edouard-chin deleted the ec-same-retry-middleware branch July 1, 2022 14:03
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.

None yet

2 participants