diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Utils/ClientExtensions.cs b/clients/algoliasearch-client-csharp/algoliasearch/Utils/ClientExtensions.cs index 7980120e3a..8433a38175 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Utils/ClientExtensions.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Utils/ClientExtensions.cs @@ -473,7 +473,7 @@ public static async Task> ReplaceAllObjectsAsync(this SearchClient new OperationIndexParams(OperationType.Move, indexName), options, cancellationToken) .ConfigureAwait(false); - await client.WaitForTaskAsync(indexName, moveResponse.TaskID, requestOptions: options, ct: cancellationToken).ConfigureAwait(false); + await client.WaitForTaskAsync(tmpIndexName, moveResponse.TaskID, requestOptions: options, ct: cancellationToken).ConfigureAwait(false); return [copyResponse.TaskID, batchResponse.TaskID, moveResponse.TaskID]; } diff --git a/templates/python/search_helpers.mustache b/templates/python/search_helpers.mustache index da9ff7109c..3d0006c1e0 100644 --- a/templates/python/search_helpers.mustache +++ b/templates/python/search_helpers.mustache @@ -225,7 +225,7 @@ responses.append(copy_resp) - await self.wait_for_task(index_name=tmp_index_name, task_id=copy_resp.task_id) + await self.wait_for_task(index_name=index_name, task_id=copy_resp.task_id) requests: List[BatchRequest] = [] @@ -253,6 +253,6 @@ responses.append(move_resp) - await self.wait_for_task(index_name=index_name, task_id=move_resp.task_id) + await self.wait_for_task(index_name=tmp_index_name, task_id=move_resp.task_id) return responses \ No newline at end of file diff --git a/tests/output/csharp/src/ClientExtensionsTests.cs b/tests/output/csharp/src/ClientExtensionsTests.cs index 1759d94573..9910b9a094 100644 --- a/tests/output/csharp/src/ClientExtensionsTests.cs +++ b/tests/output/csharp/src/ClientExtensionsTests.cs @@ -631,7 +631,10 @@ public async Task ShouldReplaceAllObjects() r.Uri.AbsolutePath, "1\\/indexes\\/my-test-index_tmp_[0-9]+\\/task\\/2" ) - || r.Uri.AbsolutePath.EndsWith("/1/indexes/my-test-index/task/3") + || Regex.IsMatch( + r.Uri.AbsolutePath, + "1\\/indexes\\/my-test-index_tmp_[0-9]+\\/task\\/3" + ) ), It.IsAny(), It.IsAny(),