algolia 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1dfdc9659fd559dda96a6bac3df7d81f455fba723f835ee62213928bb2e1ba03
4
- data.tar.gz: fd2abb719cc40db045c976e1183083986ebc13fff45a979bd6a0da4bb1cf68c1
3
+ metadata.gz: d62b0de820a85fc4e78522751cb8ebea6aae9ed3ec3093be279b1bc8e3c8b562
4
+ data.tar.gz: 25f6506b67a2331391bcb3cb5d59cefd65265c9c07d89b0d01cf208c743c9859
5
5
  SHA512:
6
- metadata.gz: ed0f1ba2efdb129534b30ec41f381d9288685aa9f88beeaea813426ba40831c3c3691727fcfd52002a6db35a0f2c3218687b2687fb3e7b71e8ccfc655b27b920
7
- data.tar.gz: 8df23199078a71911b108864b74e0c9431790fdb28cfd5cafdd811ecc31d9a860a53e9031b050b969ba73aaa49ac96555c564162fb766425c86683cc2dcfb74a
6
+ metadata.gz: 548d4e0344b4b7157d652ee0fa095735ee40d473c726c4e68149bdc0451088ea64cc1e857d369ca2e94a9ea2036ccb072e95774fc3e5fde71fc4d0d9cb07de36
7
+ data.tar.gz: 70297bf2011eeddbb2320cb44ede56fd55876268c9dc4e9edff2babb11c0b1ef5be44c18b175a59b3d4e7c1da1802c808858aa5ef715e0cd3f79a805809cf3ca
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.2..master)
4
4
 
5
+ ## [2.3.4](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.3...2.3.4) (2023-11-27)
6
+ ### Fixed
7
+ - Fixes issue with index name encoding for certain characters.
8
+
9
+ ## [2.3.3](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.2...2.3.3) (2023-11-14)
10
+ ### Fixed
11
+ - Fixed issue with connection caching for faulty hosts that accept similar requests ([`#496`](https://github.com/algolia/algoliasearch-client-ruby/pull/496))
12
+
5
13
  ## [2.3.2](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.1...2.3.2) (2023-06-07)
6
14
  ### Fixed
7
15
  - Fixed issue with Request not taking timeouts into account ([`#493`](https://github.com/algolia/algoliasearch-client-ruby/pull/493))
@@ -44,7 +44,7 @@ module Helpers
44
44
  def path_encode(path, *args)
45
45
  arguments = []
46
46
  args.each do |arg|
47
- arguments.push(CGI.escape(CGI.unescape(arg.to_s)))
47
+ arguments.push(CGI.escape(arg.to_s))
48
48
  end
49
49
 
50
50
  format(path, *arguments)
@@ -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.4'.freeze
3
3
  end
@@ -40,6 +40,10 @@ class HelpersTest
40
40
  deserialized_settings = deserialize_settings(old_settings, false)
41
41
  assert_equal new_settings, deserialized_settings
42
42
  end
43
+
44
+ def test_path_encode
45
+ assert_equal path_encode('/1/indexes/%s/settings', 'premium+ some_name'), '/1/indexes/premium%2B+some_name/settings'
46
+ end
43
47
  end
44
48
 
45
49
  describe 'test hash_includes_subset' do
@@ -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.4
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-27 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
@@ -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