Skip to content

Commit f3e8940

Browse files
authored
fix(clients): replace all objects (#2762)
1 parent a7f8902 commit f3e8940

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Utils/ClientExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public static async Task<List<long>> ReplaceAllObjectsAsync<T>(this SearchClient
473473
new OperationIndexParams(OperationType.Move, indexName), options, cancellationToken)
474474
.ConfigureAwait(false);
475475

476-
await client.WaitForTaskAsync(indexName, moveResponse.TaskID, requestOptions: options, ct: cancellationToken).ConfigureAwait(false);
476+
await client.WaitForTaskAsync(tmpIndexName, moveResponse.TaskID, requestOptions: options, ct: cancellationToken).ConfigureAwait(false);
477477

478478
return [copyResponse.TaskID, batchResponse.TaskID, moveResponse.TaskID];
479479
}

templates/python/search_helpers.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225

226226
responses.append(copy_resp)
227227

228-
await self.wait_for_task(index_name=tmp_index_name, task_id=copy_resp.task_id)
228+
await self.wait_for_task(index_name=index_name, task_id=copy_resp.task_id)
229229

230230
requests: List[BatchRequest] = []
231231

@@ -253,6 +253,6 @@
253253

254254
responses.append(move_resp)
255255

256-
await self.wait_for_task(index_name=index_name, task_id=move_resp.task_id)
256+
await self.wait_for_task(index_name=tmp_index_name, task_id=move_resp.task_id)
257257

258258
return responses

tests/output/csharp/src/ClientExtensionsTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,10 @@ public async Task ShouldReplaceAllObjects()
631631
r.Uri.AbsolutePath,
632632
"1\\/indexes\\/my-test-index_tmp_[0-9]+\\/task\\/2"
633633
)
634-
|| r.Uri.AbsolutePath.EndsWith("/1/indexes/my-test-index/task/3")
634+
|| Regex.IsMatch(
635+
r.Uri.AbsolutePath,
636+
"1\\/indexes\\/my-test-index_tmp_[0-9]+\\/task\\/3"
637+
)
635638
),
636639
It.IsAny<TimeSpan>(),
637640
It.IsAny<TimeSpan>(),

0 commit comments

Comments
 (0)