Skip to content

Commit 5b9e24a

Browse files
committed
feat: Add warning log for unsupported Weaviate server versions
1 parent bc756aa commit 5b9e24a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Weaviate.Client.Tests/Unit/TestTypedDataClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public async Task Insert_WithValidData_CallsUnderlyingDataClient()
6161
// Actual insertion would require a mock/fake HTTP client
6262
// For now, we just verify the method signature is correct
6363
Assert.NotNull(typedDataClient);
64+
await Task.CompletedTask;
6465
}
6566

6667
[Fact]
@@ -91,6 +92,7 @@ public async Task InsertMany_WithEnumerableOfT_AcceptsCorrectType()
9192
// Verify the method accepts IEnumerable<T>
9293
Assert.NotNull(typedDataClient);
9394
Assert.Equal(2, articles.Count);
95+
await Task.CompletedTask;
9496
}
9597

9698
[Fact]
@@ -111,6 +113,7 @@ public async Task InsertMany_WithTuplesOfDataAndId_AcceptsCorrectType()
111113
// Verify the method accepts tuples of (T, Guid)
112114
Assert.NotNull(typedDataClient);
113115
Assert.Equal(2, requests.Count);
116+
await Task.CompletedTask;
114117
}
115118

116119
[Fact]
@@ -131,6 +134,7 @@ public async Task InsertMany_WithTuplesOfDataAndVectors_AcceptsCorrectType()
131134
// Verify the method accepts tuples of (T, Vectors)
132135
Assert.NotNull(typedDataClient);
133136
Assert.Single(requests);
137+
await Task.CompletedTask;
134138
}
135139

136140
[Fact]
@@ -154,6 +158,7 @@ public async Task InsertMany_WithTuplesOfDataAndReferences_AcceptsCorrectType()
154158
// Verify the method accepts tuples of (T, IEnumerable<ObjectReference>)
155159
Assert.NotNull(typedDataClient);
156160
Assert.Single(requests);
161+
await Task.CompletedTask;
157162
}
158163

159164
[Fact]

src/Weaviate.Client/WeaviateClient.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@ private async Task PerformInitializationAsync(ClientConfiguration config)
269269
Modules = metaDto?.Modules?.ToDictionary() ?? [],
270270
};
271271

272+
// Log warning if connecting to a server older than 1.31.0
273+
var minSupportedVersion = new Version(1, 31, 0);
274+
if (_metaCache.HasValue && _metaCache.Value.Version < minSupportedVersion)
275+
{
276+
_logger.LogWarning(
277+
"Connected to Weaviate server version {ServerVersion}, which is earlier than the minimum supported version {MinVersion}. Some features may not work as expected.",
278+
_metaCache.Value.Version,
279+
minSupportedVersion
280+
);
281+
}
282+
272283
var maxMessageSize = _metaCache?.GrpcMaxMessageSize;
273284

274285
// Create gRPC client with metadata

0 commit comments

Comments
 (0)