mirror of
https://github.com/immich-app/isar.git
synced 2026-09-30 13:23:02 +08:00
Fixes
This commit is contained in:
@@ -23,6 +23,7 @@ target/
|
|||||||
*.dylib
|
*.dylib
|
||||||
*.dll
|
*.dll
|
||||||
*.zip
|
*.zip
|
||||||
|
*.xcframework/
|
||||||
isar-dart.h
|
isar-dart.h
|
||||||
|
|
||||||
# Android related
|
# Android related
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
## 3.0.2
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
- Fixed native ports that were not closed correctly in some cases
|
||||||
|
|
||||||
## 3.0.1
|
## 3.0.1
|
||||||
|
|
||||||
### Enhancements
|
### Enhancements
|
||||||
|
|||||||
@@ -539,6 +539,7 @@ class IsarCollectionImpl<OBJ> extends IsarCollection<OBJ> {
|
|||||||
final controller = StreamController<void>(
|
final controller = StreamController<void>(
|
||||||
onCancel: () {
|
onCancel: () {
|
||||||
IC.isar_stop_watching(handle);
|
IC.isar_stop_watching(handle);
|
||||||
|
port.close();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -569,6 +570,7 @@ class IsarCollectionImpl<OBJ> extends IsarCollection<OBJ> {
|
|||||||
final controller = StreamController<void>(
|
final controller = StreamController<void>(
|
||||||
onCancel: () {
|
onCancel: () {
|
||||||
IC.isar_stop_watching(handle);
|
IC.isar_stop_watching(handle);
|
||||||
|
port.close();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -177,18 +177,15 @@ void nCall(int result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Stream<void> wrapIsarPort(ReceivePort port) {
|
Stream<void> wrapIsarPort(ReceivePort port) {
|
||||||
final portStreamController = StreamController<void>.broadcast();
|
final portStreamController = StreamController<void>(onCancel: port.close);
|
||||||
port.listen(
|
port.listen((event) {
|
||||||
(event) {
|
if (event == 0) {
|
||||||
if (event == 0) {
|
portStreamController.add(null);
|
||||||
portStreamController.add(null);
|
} else {
|
||||||
} else {
|
final error = isarErrorFromResult(event as int);
|
||||||
final error = isarErrorFromResult(event as int);
|
portStreamController.addError(error!);
|
||||||
portStreamController.addError(error!);
|
}
|
||||||
}
|
});
|
||||||
},
|
|
||||||
onDone: portStreamController.close,
|
|
||||||
);
|
|
||||||
return portStreamController.stream;
|
return portStreamController.stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,14 +57,15 @@ class IsarImpl extends IsarCommon implements Finalizable {
|
|||||||
port.sendPort.nativePort,
|
port.sendPort.nativePort,
|
||||||
);
|
);
|
||||||
|
|
||||||
await portStream.first;
|
final txn = Txn.async(txnPtrPtr.value, write, portStream);
|
||||||
return Txn(txnPtrPtr.value, write, portStream);
|
await txn.wait();
|
||||||
|
return txn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Transaction beginTxnSync(bool write, bool silent) {
|
Transaction beginTxnSync(bool write, bool silent) {
|
||||||
nCall(IC.isar_txn_begin(ptr, _syncTxnPtrPtr, true, write, silent, 0));
|
nCall(IC.isar_txn_begin(ptr, _syncTxnPtrPtr, true, write, silent, 0));
|
||||||
return Txn(_syncTxnPtrPtr.value, write, null);
|
return Txn.sync(_syncTxnPtrPtr.value, write);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ class QueryImpl<T> extends Query<T> implements Finalizable {
|
|||||||
final controller = StreamController<void>(
|
final controller = StreamController<void>(
|
||||||
onCancel: () {
|
onCancel: () {
|
||||||
IC.isar_stop_watching(handle);
|
IC.isar_stop_watching(handle);
|
||||||
|
port.close();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ import 'package:isar/src/native/isar_core.dart';
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
class Txn extends Transaction {
|
class Txn extends Transaction {
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
Txn(this.ptr, bool write, Stream<void>? stream)
|
Txn.sync(this.ptr, bool write) : super(true, write);
|
||||||
: super(stream == null, write) {
|
|
||||||
if (stream != null) {
|
/// @nodoc
|
||||||
_completers = Queue();
|
Txn.async(this.ptr, bool write, Stream<void> stream) : super(false, write) {
|
||||||
stream.listen(
|
_completers = Queue();
|
||||||
(_) => _completers.removeFirst().complete(),
|
stream.listen(
|
||||||
onError: (Object e) => _completers.removeFirst().completeError(e),
|
(_) => _completers.removeFirst().complete(),
|
||||||
);
|
onError: (Object e) => _completers.removeFirst().completeError(e),
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An arena allocator that has the same lifetime as this transaction.
|
/// An arena allocator that has the same lifetime as this transaction.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: isar
|
name: isar
|
||||||
description: Extremely fast, easy to use, and fully async NoSQL database for Flutter.
|
description: Extremely fast, easy to use, and fully async NoSQL database for Flutter.
|
||||||
version: 3.0.0
|
version: 3.0.1
|
||||||
repository: https://github.com/isar/isar/tree/main/packages/isar
|
repository: https://github.com/isar/isar/tree/main/packages/isar
|
||||||
homepage: https://github.com/isar/isar
|
homepage: https://github.com/isar/isar
|
||||||
issue_tracker: https://github.com/isar/isar/issues
|
issue_tracker: https://github.com/isar/isar/issues
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
!*.so
|
!*.so
|
||||||
!*.a
|
!*.a
|
||||||
!*.dylib
|
!*.dylib
|
||||||
!*.dll
|
!*.dll
|
||||||
|
!*.xcframework/
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
name: isar_flutter_libs
|
name: isar_flutter_libs
|
||||||
description: Isar Core binaries for the Isar Database. Needs to be included for Flutter apps.
|
description: Isar Core binaries for the Isar Database. Needs to be included for Flutter apps.
|
||||||
version: 3.0.0
|
version: 3.0.1
|
||||||
repository: https://github.com/isar/isar
|
repository: https://github.com/isar/isar
|
||||||
homepage: https://isar.dev
|
homepage: https://isar.dev
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
isar: 3.0.0
|
isar: 3.0.1
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: isar_generator
|
name: isar_generator
|
||||||
description: Code generator for the Isar Database. Finds classes annotated with @Collection.
|
description: Code generator for the Isar Database. Finds classes annotated with @Collection.
|
||||||
version: 3.0.0
|
version: 3.0.1
|
||||||
repository: https://github.com/isar/isar
|
repository: https://github.com/isar/isar
|
||||||
homepage: https://isar.dev
|
homepage: https://isar.dev
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ dependencies:
|
|||||||
dart_style: ^2.2.3
|
dart_style: ^2.2.3
|
||||||
dartx: ^1.1.0
|
dartx: ^1.1.0
|
||||||
glob: ^2.0.2
|
glob: ^2.0.2
|
||||||
isar: 3.0.0
|
isar: 3.0.1
|
||||||
path: ^1.8.1
|
path: ^1.8.1
|
||||||
source_gen: ^1.2.2
|
source_gen: ^1.2.2
|
||||||
xxh3: ^1.0.1
|
xxh3: ^1.0.1
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ curl "${github}/libisar_android_x86.so" -o packages/isar_flutter_libs/android/sr
|
|||||||
|
|
||||||
curl "${github}/isar_ios.xcframework.zip" -o packages/isar_flutter_libs/ios/isar_ios.xcframework.zip --create-dirs -L -f
|
curl "${github}/isar_ios.xcframework.zip" -o packages/isar_flutter_libs/ios/isar_ios.xcframework.zip --create-dirs -L -f
|
||||||
unzip packages/isar_flutter_libs/ios/isar_ios.xcframework.zip -d packages/isar_flutter_libs/ios
|
unzip packages/isar_flutter_libs/ios/isar_ios.xcframework.zip -d packages/isar_flutter_libs/ios
|
||||||
|
rm packages/isar_flutter_libs/ios/isar_ios.xcframework.zip
|
||||||
|
|
||||||
curl "${github}/libisar_macos.dylib" -o packages/isar_flutter_libs/macos/libisar.dylib --create-dirs -L -f
|
curl "${github}/libisar_macos.dylib" -o packages/isar_flutter_libs/macos/libisar.dylib --create-dirs -L -f
|
||||||
install_name_tool -id @rpath/libisar.dylib packages/isar_flutter_libs/macos/libisar.dylib
|
install_name_tool -id @rpath/libisar.dylib packages/isar_flutter_libs/macos/libisar.dylib
|
||||||
|
|||||||
Reference in New Issue
Block a user