Skip to content

Update to Elastic.Transport 0.4.5 #7102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions benchmarks/Benchmarks/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -1195,7 +1195,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/Profiling/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -131,7 +131,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -143,7 +143,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
},
Expand Down Expand Up @@ -183,8 +183,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -332,7 +332,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
},
Expand Down Expand Up @@ -381,8 +381,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -529,7 +529,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
},
Expand Down Expand Up @@ -569,8 +569,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -709,7 +709,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
},
Expand Down Expand Up @@ -749,8 +749,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -849,7 +849,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
},
Expand Down Expand Up @@ -889,8 +889,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -989,7 +989,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ private static void ForceAccept<TRequest, TRequestParameters>(TRequest request,

internal static void ForceJson(IRequestConfiguration requestConfiguration)
{
requestConfiguration.Accept = RequestData.MimeType;
requestConfiguration.ContentType = RequestData.MimeType;
requestConfiguration.Accept = RequestData.DefaultMimeType;
requestConfiguration.ContentType = RequestData.DefaultMimeType;
}

internal static void ForceTextPlain(IRequestConfiguration requestConfiguration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ namespace Elastic.Clients.Elasticsearch;

public static class ElasticsearchResponseExtensions
{
public static bool IsSuccess(this ElasticsearchResponse response) => response.ApiCallDetails is not null && response.ApiCallDetails.HasSuccessfulStatusCode;
public static bool IsSuccess(this ElasticsearchResponse response) => response.ApiCallDetails is not null
&& response.ApiCallDetails.HasSuccessfulStatusCode
&& response.ApiCallDetails.HasExpectedContentType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Nullable>annotations</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elastic.Transport" Version="0.4.3" />
<PackageReference Include="Elastic.Transport" Version="0.4.5" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.3.44">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private async Task<BulkAllResponse> BulkAsync(IList<T> buffer, long page, int ba
_compositeCancelToken.ThrowIfCancellationRequested();
_bulkResponseCallback?.Invoke(response);

if (!response.ApiCallDetails.HasSuccessfulStatusCode)
if (!response.ApiCallDetails.HasSuccessfulStatusCode || !response.ApiCallDetails.HasExpectedContentType)
return await HandleBulkRequestAsync(buffer, page, backOffRetries, response).ConfigureAwait(false);

var retryableDocuments = new List<T>();
Expand Down
36 changes: 18 additions & 18 deletions src/Elastic.Clients.Elasticsearch/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
},
"Elastic.Transport": {
"type": "Direct",
"requested": "[0.4.3, )",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"requested": "[0.4.5, )",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -163,9 +163,9 @@
},
"Elastic.Transport": {
"type": "Direct",
"requested": "[0.4.3, )",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"requested": "[0.4.5, )",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -347,9 +347,9 @@
},
"Elastic.Transport": {
"type": "Direct",
"requested": "[0.4.3, )",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"requested": "[0.4.5, )",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -539,9 +539,9 @@
},
"Elastic.Transport": {
"type": "Direct",
"requested": "[0.4.3, )",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"requested": "[0.4.5, )",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -714,9 +714,9 @@
},
"Elastic.Transport": {
"type": "Direct",
"requested": "[0.4.3, )",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"requested": "[0.4.5, )",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -849,9 +849,9 @@
},
"Elastic.Transport": {
"type": "Direct",
"requested": "[0.4.3, )",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"requested": "[0.4.5, )",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down
6 changes: 3 additions & 3 deletions src/Playground/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -153,7 +153,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
},
"elastic.clients.elasticsearch.jsonnetserializer": {
Expand Down
18 changes: 9 additions & 9 deletions tests/Tests.ClusterLauncher/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -1271,7 +1271,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
},
"elastic.clients.elasticsearch.jsonnetserializer": {
Expand Down Expand Up @@ -1388,8 +1388,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -2588,7 +2588,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
},
"elastic.clients.elasticsearch.jsonnetserializer": {
Expand Down Expand Up @@ -2705,8 +2705,8 @@
},
"Elastic.Transport": {
"type": "Transitive",
"resolved": "0.4.3",
"contentHash": "U4yHxScZG7YMDJJ9KGGWfhNx543NQmWlNPILyrd5UF0VMFfjuTZ+RXtWRCX8xMrqcSl4pUBKE+G4GoIVA65ZUQ==",
"resolved": "0.4.5",
"contentHash": "iy3ekUGcbHCDAWCcaG7+IERXouKJ6ta3CXiqAGwdhu1FYudqnAzo1UBdPeQQHmYYGNvQ/cqLHAUQW+1Zh/i6KA==",
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Buffers": "4.5.1",
Expand Down Expand Up @@ -3905,7 +3905,7 @@
"elastic.clients.elasticsearch": {
"type": "Project",
"dependencies": {
"Elastic.Transport": "[0.4.3, )"
"Elastic.Transport": "[0.4.5, )"
}
},
"elastic.clients.elasticsearch.jsonnetserializer": {
Expand Down
6 changes: 3 additions & 3 deletions tests/Tests.Core/Client/FixedResponseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static ElasticsearchClient Create(
object response,
int statusCode = 200,
Func<ElasticsearchClientSettings, ElasticsearchClientSettings> modifySettings = null,
string contentType = RequestData.MimeType,
string contentType = RequestData.DefaultMimeType,
Exception exception = null
)
{
Expand All @@ -29,7 +29,7 @@ public static ElasticsearchClientSettings CreateConnectionSettings(
object response,
int statusCode = 200,
Func<ElasticsearchClientSettings, ElasticsearchClientSettings> modifySettings = null,
string contentType = RequestData.MimeType,
string contentType = RequestData.DefaultMimeType,
Exception exception = null,
Serializer serializer = null
)
Expand All @@ -46,7 +46,7 @@ public static ElasticsearchClientSettings CreateConnectionSettings(
break;
default:
{
responseBytes = contentType == RequestData.MimeType
responseBytes = contentType == RequestData.DefaultMimeType
? serializer.SerializeToBytes(response,
TestClient.Default.ElasticsearchClientSettings.MemoryStreamFactory)
: Encoding.UTF8.GetBytes(response.ToString());
Expand Down
Loading