@algolia/client-search 5.50.2 → 5.51.0

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.
@@ -11,7 +11,7 @@ import {
11
11
  getAlgoliaAgent,
12
12
  shuffle
13
13
  } from "@algolia/client-common";
14
- var apiClientVersion = "5.50.2";
14
+ var apiClientVersion = "5.51.0";
15
15
  function getDefaultHosts(appId) {
16
16
  return [
17
17
  {
@@ -121,14 +121,14 @@ function createSearchClient({
121
121
  * @param waitForTaskOptions - The `waitForTaskOptions` object.
122
122
  * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
123
123
  * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
124
- * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
124
+ * @param waitForTaskOptions.maxRetries - The maximum number of retries. 100 by default.
125
125
  * @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.
126
126
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
127
127
  */
128
128
  waitForTask({
129
129
  indexName,
130
130
  taskID,
131
- maxRetries = 50,
131
+ maxRetries = 100,
132
132
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
133
133
  }, requestOptions) {
134
134
  let retryCount = 0;
@@ -138,7 +138,7 @@ function createSearchClient({
138
138
  aggregator: () => retryCount += 1,
139
139
  error: {
140
140
  validate: () => retryCount >= maxRetries,
141
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
141
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
142
142
  },
143
143
  timeout: () => timeout(retryCount)
144
144
  });
@@ -149,13 +149,13 @@ function createSearchClient({
149
149
  * @summary Helper method that waits for a task to be published (completed).
150
150
  * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
151
151
  * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
152
- * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
152
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 100 by default.
153
153
  * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
154
154
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
155
155
  */
156
156
  waitForAppTask({
157
157
  taskID,
158
- maxRetries = 50,
158
+ maxRetries = 100,
159
159
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
160
160
  }, requestOptions) {
161
161
  let retryCount = 0;
@@ -165,7 +165,7 @@ function createSearchClient({
165
165
  aggregator: () => retryCount += 1,
166
166
  error: {
167
167
  validate: () => retryCount >= maxRetries,
168
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
168
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
169
169
  },
170
170
  timeout: () => timeout(retryCount)
171
171
  });
@@ -178,7 +178,7 @@ function createSearchClient({
178
178
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
179
179
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
180
180
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
181
- * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.
181
+ * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 100 by default.
182
182
  * @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.
183
183
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
184
184
  */
@@ -186,7 +186,7 @@ function createSearchClient({
186
186
  operation,
187
187
  key,
188
188
  apiKey,
189
- maxRetries = 50,
189
+ maxRetries = 100,
190
190
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
191
191
  }, requestOptions) {
192
192
  let retryCount = 0;
@@ -194,7 +194,7 @@ function createSearchClient({
194
194
  aggregator: () => retryCount += 1,
195
195
  error: {
196
196
  validate: () => retryCount >= maxRetries,
197
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
197
+ message: () => `Stopped waiting for the API key operation after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
198
198
  },
199
199
  timeout: () => timeout(retryCount)
200
200
  };