realm-dart-samples
realm-dart-samples copied to clipboard
Realm notifications are not working
I have cloned this repo and used the time_track example. The watch command doesn't update the console with added tasks, the realm.changes never notifies.
Running Mac OS Monterey 12.4
Update - July 25, 2022
The notifications work when I compile the time_track.dart into an exe. However, still, no luck when I run time_track.dart directly.
Hi @markandeyp! I see your question so late. You can write issues to https://github.com/realm/realm-dart/issues if you don't receive answer here. You are right, there was a problem with cross process notifications if they are under vs code. I will check this issue with @nielsenko and will give you an answer here.
Hi @desistefanova, thanks for a response here. The notification issue was reproducible even outside VS code. Let me know if a solution is available.
@markandeyp & @desistefanova Yes this has nothing to do with VS code.
There is an issue with how interprocess notifications behaves when the dart interpreter is involved in loading the realm core shared library.
The work-around as previously discussed on a call, is to compile the time_track
command AOT, as done in the screencast.
In general, I suggest compiling CLI tools using Realm, as it greatly reduces the startup time, which is especially important for CLI tools.
I do hope to get to the bottom of this eventually, but it is not a top priority for us, as an easy work-around exists.
Notice that this does not concern in-process notification. In particular it does not impact notifications due to synchronization.