algolia 2.2.2 → 2.2.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: 5c2f4626569fa71c66f1801a6608a0d66bdd7afc5d2d42342856d8083281d0ee
4
- data.tar.gz: bbc716503ac0354dd80a1e5d1196cfc8ff5e8d80c3c166c196bd1ec5e227a446
3
+ metadata.gz: c113b61e6f68cb0512af5184ec64500c3dfcce89cef1f72fa07c25c9276f5cb1
4
+ data.tar.gz: 6474ee0b14ce28607a2a17bb2353fd7853128d48694f93d608b7faae728044b8
5
5
  SHA512:
6
- metadata.gz: bd82583938e41074786a9f6e3518256af5f54c6946e8224a9e2ecc40952f211475dbec10ba5d054058764bdccbdceff80a9147c195a8c3f62a5ab4f033c11757
7
- data.tar.gz: 25971344a9f64260d29f8c1a7878605a2e408369de05b4e4add74e828697cefde461bb83ed5564dbd6f94de3844844e6e357568e830de53a3d77253a27151e33
6
+ metadata.gz: efab3e1d53bb186dc091e69e00962223adb1f7c17567e0fbcd97609ed07fc6cb99ae6552e08852f19c3815bd1164fde3475fc74f2445b8c4909f4de5258ee405
7
+ data.tar.gz: 7c961f777ab5616edd3c59c0049ffd5b2b74126cd79697ebcdb4ffee42822866cab8fae0ab7a8922c434479fb032d9d865e83ba7b46543dd7a6b32a013d555ff
data/CHANGELOG.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # ChangeLog
2
2
 
3
- ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.2..master)
3
+ ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.3..master)
4
4
 
5
- ## [2.2.1](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.1...2.2.2) (2021-12-08)
5
+ ## [2.2.3](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.2...2.2.3) (2022-04-21)
6
+ ### Fixed
7
+ - API polling flood issue due to msec sleep time mishandling ([`#472`](https://github.com/algolia/algoliasearch-client-ruby/pull/472))
8
+ - mailto link in SECURITY.md ([`#463`](https://github.com/algolia/algoliasearch-client-ruby/pull/463))
9
+
10
+ ### Added
11
+ - allow hash in multiple queries ([`#468`](https://github.com/algolia/algoliasearch-client-ruby/pull/468))
12
+
13
+ ## [2.2.2](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.1...2.2.2) (2021-12-08)
6
14
  ### Fixed
7
15
  - Added a `status` field to the `MockRequester` ([`#467`](https://github.com/algolia/algoliasearch-client-ruby/pull/467))
8
16
 
data/SECURITY.md CHANGED
@@ -1,3 +1,3 @@
1
1
  ## Reporting a Vulnerability
2
2
 
3
- To report a security vulnerability, please use the [Algolia security email](security@algolia.com). Algolia will coordinate the fix and disclosure.
3
+ To report a security vulnerability, please use the [Algolia security email](mailto:security@algolia.com). Algolia will coordinate the fix and disclosure.
@@ -28,7 +28,7 @@ module Algolia
28
28
  end
29
29
  retries_count += 1
30
30
  time_before_retry = retries_count * Defaults::WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY
31
- sleep(time_before_retry / 1000)
31
+ sleep(time_before_retry.to_f / 1000)
32
32
  end
33
33
  end
34
34
 
@@ -29,7 +29,7 @@ module Algolia
29
29
  unless @done
30
30
  retries_count += 1
31
31
  time_before_retry = retries_count * Defaults::WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY
32
- sleep(time_before_retry / 1000)
32
+ sleep(time_before_retry.to_f / 1000)
33
33
  end
34
34
  end
35
35
  end
@@ -26,7 +26,7 @@ module Algolia
26
26
  end
27
27
  retries_count += 1
28
28
  time_before_retry = retries_count * Defaults::WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY
29
- sleep(time_before_retry / 1000)
29
+ sleep(time_before_retry.to_f / 1000)
30
30
  end
31
31
  end
32
32
 
@@ -29,7 +29,7 @@ module Algolia
29
29
  raise e unless e.code == 404
30
30
  retries_count += 1
31
31
  time_before_retry = retries_count * Defaults::WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY
32
- sleep(time_before_retry / 1000)
32
+ sleep(time_before_retry.to_f / 1000)
33
33
  end
34
34
  end
35
35
 
@@ -478,6 +478,9 @@ module Algolia
478
478
  # @return [Hash]
479
479
  #
480
480
  def multiple_queries(queries, opts = {})
481
+ queries.each do |q|
482
+ q[:params] = to_query_string(q[:params]) unless q[:params].is_a?(String)
483
+ end
481
484
  @transporter.read(:POST, '/1/indexes/*/queries', { requests: queries }, opts)
482
485
  end
483
486
  alias_method :search, :multiple_queries
@@ -36,7 +36,7 @@ module Algolia
36
36
  if status == 'published'
37
37
  return
38
38
  end
39
- sleep(time_before_retry / 1000)
39
+ sleep(time_before_retry.to_f / 1000)
40
40
  end
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = '2.2.2'.freeze
2
+ VERSION = '2.2.3'.freeze
3
3
  end
@@ -14,7 +14,7 @@ class AccountClientTest < BaseTest
14
14
 
15
15
  search_client2 = Algolia::Search::Client.create(APPLICATION_ID_2, ADMIN_KEY_2)
16
16
  index2 = search_client2.init_index(get_test_index_name('copy_index2'))
17
- index1.save_object!({ objectID: 'one' })
17
+ index1.save_object!({ objectID: 'one', title: 'Test title' })
18
18
  index1.save_rule!({
19
19
  objectID: 'one',
20
20
  condition: { anchoring: 'is', pattern: 'pattern' },
@@ -29,7 +29,7 @@ class AccountClientTest < BaseTest
29
29
  }
30
30
  })
31
31
  index1.save_synonym!({ objectID: 'one', type: 'synonym', synonyms: %w(one two) })
32
- index1.set_settings!({ searchableAttributes: ['objectID'] })
32
+ index1.set_settings!({ searchableAttributes: ['title'] })
33
33
 
34
34
  Algolia::Account::Client.copy_index!(index1, index2)
35
35
  assert_equal 'one', index2.get_object('one')[:objectID]
@@ -294,7 +294,7 @@ class SearchClientTest < BaseTest
294
294
 
295
295
  results = @@search_client.multiple_queries([
296
296
  { indexName: index_name1, params: to_query_string({ query: '', hitsPerPage: 2 }) },
297
- { indexName: index_name2, params: to_query_string({ query: '', hitsPerPage: 2 }) }
297
+ { indexName: index_name2, params: { query: '', hitsPerPage: 2 } }
298
298
  ], { strategy: 'none' })[:results]
299
299
 
300
300
  assert_equal 2, results.length
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.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-08 00:00:00.000000000 Z
11
+ date: 2022-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler