algolia 2.3.2 → 2.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1dfdc9659fd559dda96a6bac3df7d81f455fba723f835ee62213928bb2e1ba03
4
- data.tar.gz: fd2abb719cc40db045c976e1183083986ebc13fff45a979bd6a0da4bb1cf68c1
3
+ metadata.gz: '0492459cd5b8a7ddc8abba6d658c1d4c5a5c8ddedbdc16ea2a8e8395588ae1ba'
4
+ data.tar.gz: e0d522ddb114dddf1fbb578b5c8a56a23d6b4a1c717aa30e4c86512a67b96d82
5
5
  SHA512:
6
- metadata.gz: ed0f1ba2efdb129534b30ec41f381d9288685aa9f88beeaea813426ba40831c3c3691727fcfd52002a6db35a0f2c3218687b2687fb3e7b71e8ccfc655b27b920
7
- data.tar.gz: 8df23199078a71911b108864b74e0c9431790fdb28cfd5cafdd811ecc31d9a860a53e9031b050b969ba73aaa49ac96555c564162fb766425c86683cc2dcfb74a
6
+ metadata.gz: c919b2855a50b42a1a01e832e0ef4560cb852a540dee2ca969af328413e042e1b70dda29543721cdd3c823fab024da1059704d6c525a5e0d359bff5d605846d0
7
+ data.tar.gz: 418cdc6b559ef6a591bacc3808fa079a5442089249f4097a84630631320d9d5d80a4e786567d706231c8a868b8ca05c306c5cd98f28615cda855275e19c31f8c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.2..master)
4
4
 
5
+ ## [2.3.2](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.2...2.3.3) (2023-11-14)
6
+ ### Fixed
7
+ - Fixed issue with connection caching for faulty hosts that accept similar requests ([`#496`](https://github.com/algolia/algoliasearch-client-ruby/pull/496))
8
+
5
9
  ## [2.3.2](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.1...2.3.2) (2023-06-07)
6
10
  ### Fixed
7
11
  - Fixed issue with Request not taking timeouts into account ([`#493`](https://github.com/algolia/algoliasearch-client-ruby/pull/493))
@@ -65,7 +65,7 @@ module Algolia
65
65
  # @return [Faraday::Connection]
66
66
  #
67
67
  def connection(host)
68
- @connections[host.accept] ||= Faraday.new(build_url(host)) do |f|
68
+ @connections[host.url] ||= Faraday.new(build_url(host)) do |f|
69
69
  f.adapter @adapter.to_sym
70
70
  end
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = '2.3.2'.freeze
2
+ VERSION = '2.3.3'.freeze
3
3
  end
@@ -0,0 +1,27 @@
1
+ require 'algolia'
2
+ require 'test_helper'
3
+
4
+ class HttpRequesterTest
5
+ describe 'connection' do
6
+ def test_caches_http_client_connections
7
+ requester = Algolia::Http::HttpRequester.new(Defaults::ADAPTER, nil)
8
+ host1 = Algolia::Transport::StatefulHost.new('host1')
9
+
10
+ # rubocop:disable Lint/UselessComparison
11
+ assert requester.connection(host1) == requester.connection(host1)
12
+ # rubocop:enable Lint/UselessComparison
13
+ assert_equal requester.connection(host1).url_prefix.host, 'host1'
14
+ end
15
+
16
+ def test_caches_hosts_independent_of_each_other
17
+ requester = Algolia::Http::HttpRequester.new(Defaults::ADAPTER, nil)
18
+ host1 = Algolia::Transport::StatefulHost.new('host1')
19
+ host2 = Algolia::Transport::StatefulHost.new('host2')
20
+
21
+ assert requester.connection(host1) != requester.connection(host2)
22
+
23
+ assert_equal requester.connection(host1).url_prefix.host, 'host1'
24
+ assert_equal requester.connection(host2).url_prefix.host, 'host2'
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-07 00:00:00.000000000 Z
11
+ date: 2023-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -306,6 +306,7 @@ files:
306
306
  - test/algolia/integration/search_index_test.rb
307
307
  - test/algolia/unit/algolia_config_test.rb
308
308
  - test/algolia/unit/helpers_test.rb
309
+ - test/algolia/unit/http_requester_test.rb
309
310
  - test/algolia/unit/retry_strategy_test.rb
310
311
  - test/algolia/unit/user_agent_test.rb
311
312
  - test/test_helper.rb
@@ -332,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
333
  - !ruby/object:Gem::Version
333
334
  version: '0'
334
335
  requirements: []
335
- rubygems_version: 3.0.3.1
336
+ rubygems_version: 3.2.15
336
337
  signing_key:
337
338
  specification_version: 4
338
339
  summary: A simple Ruby client for the algolia.com REST API
@@ -349,6 +350,7 @@ test_files:
349
350
  - test/algolia/integration/search_index_test.rb
350
351
  - test/algolia/unit/algolia_config_test.rb
351
352
  - test/algolia/unit/helpers_test.rb
353
+ - test/algolia/unit/http_requester_test.rb
352
354
  - test/algolia/unit/retry_strategy_test.rb
353
355
  - test/algolia/unit/user_agent_test.rb
354
356
  - test/test_helper.rb