realm-dart-samples icon indicating copy to clipboard operation
realm-dart-samples copied to clipboard

Realm notifications are not working

Open markandeyp opened this issue 2 years ago • 5 comments

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

markandeyp avatar Jul 18 '22 05:07 markandeyp

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.

markandeyp avatar Jul 25 '22 16:07 markandeyp

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.

desistefanova avatar Dec 21 '22 21:12 desistefanova

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 avatar Jan 13 '23 22:01 markandeyp

@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.

nielsenko avatar Jan 19 '23 10:01 nielsenko