Skip to content

Commit f4fb25c

Browse files
committed
oops
1 parent 1d92463 commit f4fb25c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/powersync_core/lib/src/database/core_version.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ extension type const PowerSyncCoreVersion((int, int, int) _tuple) {
1717
};
1818
}
1919

20+
bool operator <(PowerSyncCoreVersion other) => compareTo(other) < 0;
2021
bool operator >=(PowerSyncCoreVersion other) => compareTo(other) >= 0;
2122

2223
String get versionString => '$major.$minor.$patch';
2324

2425
void checkSupported() {
2526
const isWeb = bool.fromEnvironment('dart.library.js_interop');
2627

27-
if (minimum >= this || this >= maximumExclusive) {
28+
if (this < minimum || this >= maximumExclusive) {
2829
var message =
2930
'Unsupported powersync extension version. This version of the '
3031
'PowerSync SDK needs >=${minimum.versionString} '

packages/powersync_core/test/database/core_version_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ void main() {
2828
test('checkSupported', () {
2929
expect(PowerSyncCoreVersion.parse('0.3.10').checkSupported,
3030
throwsA(isA<SqliteException>()));
31-
expect(PowerSyncCoreVersion.parse('0.4.5').checkSupported,
32-
isNot(throwsA(anything)));
3331
expect(PowerSyncCoreVersion.parse('1.0.0').checkSupported,
3432
throwsA(isA<SqliteException>()));
33+
34+
PowerSyncCoreVersion.minimum.checkSupported();
35+
expect(PowerSyncCoreVersion.maximumExclusive.checkSupported,
36+
throwsA(isA<SqliteException>()));
3537
});
3638
});
3739
}

0 commit comments

Comments
 (0)