Skip to content

Commit 7a27fd0

Browse files
instance_version_warning
1 parent 44708f9 commit 7a27fd0

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/data/path.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isValidStringProperty } from '../validation/string';
22
import { DbVersionSupport } from '../utils/dbVersion';
33
import { ConsistencyLevel } from './replication';
4-
import { isValidWeaviateVersion } from '../validation/version';
4+
import { isNotValidWeaviateVersion } from '../validation/version';
55

66
const objectsPathPrefix = '/objects';
77

@@ -177,11 +177,11 @@ export class ReferencesPath {
177177
} else {
178178
support.warns.notSupportedClassNamespacedEndpointsForReferences();
179179
}
180-
if(support.version){
181-
if (isValidWeaviateVersion(support.version)){
180+
if (support.version) {
181+
if (isNotValidWeaviateVersion(support.version)) {
182182
support.warns.deprecatedWeaviateTooOld();
183183
}
184-
}
184+
}
185185
if (isValidStringProperty(id)) {
186186
path = `${path}/${id}`;
187187
}

src/utils/beaconPath.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isValidStringProperty } from '../validation/string';
22
import { DbVersionSupport } from './dbVersion';
3-
import { isValidWeaviateVersion } from '../validation/version';
3+
import { isNotValidWeaviateVersion } from '../validation/version';
44

55
const beaconPathPrefix = 'weaviate://localhost';
66

@@ -42,11 +42,11 @@ export class BeaconPath {
4242
} else {
4343
support.warns.notSupportedClassNamespacedEndpointsForBeacons();
4444
}
45-
if(support.version){
46-
if (isValidWeaviateVersion(support.version)){
45+
if (support.version) {
46+
if (isNotValidWeaviateVersion(support.version)) {
4747
support.warns.deprecatedWeaviateTooOld();
4848
}
49-
}
49+
}
5050
if (isValidStringProperty(id)) {
5151
beaconPath = `${beaconPath}/${id}`;
5252
}

src/validation/version.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
export function isValidWeaviateVersion(version: string) {
2-
if (typeof version === 'string') {
3-
const versionNumbers = version.split('.');
4-
if (versionNumbers.length >= 2) {
5-
const major = parseInt(versionNumbers[0], 10);
6-
const minor = parseInt(versionNumbers[1], 10);
7-
return (major <= 1 && minor < 16);
8-
}
1+
export function isNotValidWeaviateVersion(version: string) {
2+
if (typeof version === 'string') {
3+
const versionNumbers = version.split('.');
4+
if (versionNumbers.length >= 2) {
5+
const major = parseInt(versionNumbers[0], 10);
6+
const minor = parseInt(versionNumbers[1], 10);
7+
return major <= 1 && minor < 16;
98
}
10-
return false;
11-
}
9+
}
10+
return false;
11+
}

0 commit comments

Comments
 (0)