algolia 2.3.1 → 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: b193b6e9fe46cce4bfb184ab2a5c8ec753089d1d01264f541ac5c5034b54e9f2
4
- data.tar.gz: e014c7c1614e265cfc326ee405b896a8f2218a5840ba45d7ce559f88bd986e29
3
+ metadata.gz: '0492459cd5b8a7ddc8abba6d658c1d4c5a5c8ddedbdc16ea2a8e8395588ae1ba'
4
+ data.tar.gz: e0d522ddb114dddf1fbb578b5c8a56a23d6b4a1c717aa30e4c86512a67b96d82
5
5
  SHA512:
6
- metadata.gz: fce94b90048c35fa6b76e09f6ae8ff758854bce4089cc0a274ffe8fceb4a6e4623e90428b48a548b45971ed8aab8998da86f4168bf93f56cffcc8fd947803f01
7
- data.tar.gz: 9db43a1ecbcf5940fd8896b454ef17f2fa457955219b01cd52cf1c8d52465026b5e4881272b4faed44c93be4acf11310c865ce4abb5ddff66e0397ed4aa465e6
6
+ metadata.gz: c919b2855a50b42a1a01e832e0ef4560cb852a540dee2ca969af328413e042e1b70dda29543721cdd3c823fab024da1059704d6c525a5e0d359bff5d605846d0
7
+ data.tar.gz: 418cdc6b559ef6a591bacc3808fa079a5442089249f4097a84630631320d9d5d80a4e786567d706231c8a868b8ca05c306c5cd98f28615cda855275e19c31f8c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # ChangeLog
2
2
 
3
- ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.1..master)
3
+ ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.2..master)
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
+
9
+ ## [2.3.2](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.1...2.3.2) (2023-06-07)
10
+ ### Fixed
11
+ - Fixed issue with Request not taking timeouts into account ([`#493`](https://github.com/algolia/algoliasearch-client-ruby/pull/493))
4
12
 
5
13
  ## [2.3.1](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.0...2.3.1) (2022-09-26)
6
14
  ### Fixed
@@ -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
@@ -91,11 +91,13 @@ module Algolia
91
91
  # @return [Hash]
92
92
  #
93
93
  def build_request(method, path, body, request_options)
94
- request = {}
95
- request[:method] = method.downcase
96
- request[:path] = build_uri_path(path, request_options.params)
97
- request[:body] = build_body(body, request_options, method)
98
- request[:headers] = generate_headers(request_options)
94
+ request = {}
95
+ request[:method] = method.downcase
96
+ request[:path] = build_uri_path(path, request_options.params)
97
+ request[:body] = build_body(body, request_options, method)
98
+ request[:headers] = generate_headers(request_options)
99
+ request[:timeout] = request_options.timeout
100
+ request[:connect_timeout] = request_options.connect_timeout
99
101
  request
100
102
  end
101
103
 
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = '2.3.1'.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.1
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: 2022-10-21 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