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
|
||||
*.dll
|
||||
*.zip
|
||||
*.xcframework/
|
||||
isar-dart.h
|
||||
|
||||
# Android related
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
## 3.0.2
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fixed native ports that were not closed correctly in some cases
|
||||
|
||||
## 3.0.1
|
||||
|
||||
### Enhancements
|
||||
|
||||
@@ -539,6 +539,7 @@ class IsarCollectionImpl<OBJ> extends IsarCollection<OBJ> {
|
||||
final controller = StreamController<void>(
|
||||
onCancel: () {
|
||||
IC.isar_stop_watching(handle);
|
||||
port.close();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -569,6 +570,7 @@ class IsarCollectionImpl<OBJ> extends IsarCollection<OBJ> {
|
||||
final controller = StreamController<void>(
|
||||
onCancel: () {
|
||||
IC.isar_stop_watching(handle);
|
||||
port.close();
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -177,18 +177,15 @@ void nCall(int result) {
|
||||
}
|
||||
|
||||
Stream<void> wrapIsarPort(ReceivePort port) {
|
||||
final portStreamController = StreamController<void>.broadcast();
|
||||
port.listen(
|
||||
(event) {
|
||||
if (event == 0) {
|
||||
portStreamController.add(null);
|
||||
} else {
|
||||
final error = isarErrorFromResult(event as int);
|
||||
portStreamController.addError(error!);
|
||||
}
|
||||
},
|
||||
onDone: portStreamController.close,
|
||||
);
|
||||
final portStreamController = StreamController<void>(onCancel: port.close);
|
||||
port.listen((event) {
|
||||
if (event == 0) {
|
||||
portStreamController.add(null);
|
||||
} else {
|
||||
final error = isarErrorFromResult(event as int);
|
||||
portStreamController.addError(error!);
|
||||
}
|
||||
});
|
||||
return portStreamController.stream;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,14 +57,15 @@ class IsarImpl extends IsarCommon implements Finalizable {
|
||||
port.sendPort.nativePort,
|
||||
);
|
||||
|
||||
await portStream.first;
|
||||
return Txn(txnPtrPtr.value, write, portStream);
|
||||
final txn = Txn.async(txnPtrPtr.value, write, portStream);
|
||||
await txn.wait();
|
||||
return txn;
|
||||
}
|
||||
|
||||
@override
|
||||
Transaction beginTxnSync(bool write, bool silent) {
|
||||
nCall(IC.isar_txn_begin(ptr, _syncTxnPtrPtr, true, write, silent, 0));
|
||||
return Txn(_syncTxnPtrPtr.value, write, null);
|
||||
return Txn.sync(_syncTxnPtrPtr.value, write);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -129,6 +129,7 @@ class QueryImpl<T> extends Query<T> implements Finalizable {
|
||||
final controller = StreamController<void>(
|
||||
onCancel: () {
|
||||
IC.isar_stop_watching(handle);
|
||||
port.close();
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@ import 'package:isar/src/native/isar_core.dart';
|
||||
/// @nodoc
|
||||
class Txn extends Transaction {
|
||||
/// @nodoc
|
||||
Txn(this.ptr, bool write, Stream<void>? stream)
|
||||
: super(stream == null, write) {
|
||||
if (stream != null) {
|
||||
_completers = Queue();
|
||||
stream.listen(
|
||||
(_) => _completers.removeFirst().complete(),
|
||||
onError: (Object e) => _completers.removeFirst().completeError(e),
|
||||
);
|
||||
}
|
||||
Txn.sync(this.ptr, bool write) : super(true, write);
|
||||
|
||||
/// @nodoc
|
||||
Txn.async(this.ptr, bool write, Stream<void> stream) : super(false, write) {
|
||||
_completers = Queue();
|
||||
stream.listen(
|
||||
(_) => _completers.removeFirst().complete(),
|
||||
onError: (Object e) => _completers.removeFirst().completeError(e),
|
||||
);
|
||||
}
|
||||
|
||||
/// An arena allocator that has the same lifetime as this transaction.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: isar
|
||||
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
|
||||
homepage: https://github.com/isar/isar
|
||||
issue_tracker: https://github.com/isar/isar/issues
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
!*.a
|
||||
!*.dylib
|
||||
!*.dll
|
||||
!*.xcframework/
|
||||
@@ -1,6 +1,6 @@
|
||||
name: isar_flutter_libs
|
||||
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
|
||||
homepage: https://isar.dev
|
||||
|
||||
@@ -11,7 +11,7 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
isar: 3.0.0
|
||||
isar: 3.0.1
|
||||
|
||||
flutter:
|
||||
plugin:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: isar_generator
|
||||
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
|
||||
homepage: https://isar.dev
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies:
|
||||
dart_style: ^2.2.3
|
||||
dartx: ^1.1.0
|
||||
glob: ^2.0.2
|
||||
isar: 3.0.0
|
||||
isar: 3.0.1
|
||||
path: ^1.8.1
|
||||
source_gen: ^1.2.2
|
||||
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
|
||||
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
|
||||
install_name_tool -id @rpath/libisar.dylib packages/isar_flutter_libs/macos/libisar.dylib
|
||||
|
||||
Reference in New Issue
Block a user