You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current observer implementation (used by query streams) is broken if the data is created by more than one isolate. In that case, the observer callback from the native side is executed in a "wrong" isolate, crashing the program.
This is really an issue affecting any async callbacks from the native side, I'll create a followup to address it in a generic way.
In case the Store is only used from a single isolate, it should work fine AFAICT because the callback is issued from the same isolate. However, with the introduction of SyncClient, the observer may be called asynchronously even though lib user only uses a single isolate so this must be addressed.
The text was updated successfully, but these errors were encountered:
Related to observers but not the same issue: resource management seems a little hard to do with Query.findStream() - the query itself must be closed at some point to avoid memory leak. e.g. stream_test.dart don't follow this...
Current observer implementation (used by query streams) is broken if the data is created by more than one isolate. In that case, the observer callback from the native side is executed in a "wrong" isolate, crashing the program.
Test-case to reproduce: https://github.com/objectbox/objectbox-dart/blob/async-and-isolates/test/isolates_test.dart#L85
error: Cannot invoke callback on incorrect isolate.
This is really an issue affecting any async callbacks from the native side, I'll create a followup to address it in a generic way.
In case the Store is only used from a single isolate, it should work fine AFAICT because the callback is issued from the same isolate. However, with the introduction of SyncClient, the observer may be called asynchronously even though lib user only uses a single isolate so this must be addressed.
The text was updated successfully, but these errors were encountered: