-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to sync data in widget? #176
Comments
did you figure it out? this is worrisome |
Hey, would need more information to possibly look into this. Things like snippets, a description of your flow, a description of how many Realms you're using and where you're storing... |
I also just ran into this with a UUID PK. I'm looking into it. |
First off I see that IceCream treats insertions and modifications to the realm db the same: https://github.com/caiyue1993/IceCream/blob/0b6b24a4eddc331361f3123eab48ef116b123161/IceCream/Classes/SyncObject.swift#L136-L149 whereas SyncKit treats them specially. I think this may be a mistake and source of a race condition or similar issue |
I've fixed it with defensive coding in my fork, BigSyncKit: lake-of-fire/BigSyncKit@c2d9e18 I collapsed .new and .changed into .newOrChanged and then allowed the realm.add to update an existing object at the site of the crash. |
My project has added widget. Without the need to open the app, the data needs to be updated synchronously when the widget is updated, so I created a synchronizer in both the app and the widget, or created a synchronizer in a singleton class to give app and widget use. However, after the widget is synchronized, opening the app and synchronizing the realm in the app will report the following error:
*** Terminating app due to uncaught exception 'RLMException', reason: 'Attempting to create an object of type 'GroupMessage' with an existing primary key value 'D2CB7AB4-D505-4568-83D1-CBA8EB28408B'.'
The text was updated successfully, but these errors were encountered: