-
-
Notifications
You must be signed in to change notification settings - Fork 255
Support public database #124
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
Conversation
I'm getting an error when building the pull request example project.
From this function.
|
If I'm not mistaken this gets us like 40% of the way to a viable solution for #4. Great stuff. I'll start from the latest then. |
@rodericj Glad to hear that. Indeed I've refactored the code structure and make it much more reasonable I think. |
|
||
@objc func add() { | ||
let user = Person() | ||
user.name = "Yue Cai" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's interesting is that the first time I ran this I got "Jim" added to my Realm. I see that it's defaulted to Jim, but I don't really see how that wasn't overridden given that this is how we add the new users.
I'm getting pretty deep into the implementation here but I'm wondering what the expected use is for this conditional:
I'm looking to use something similar, or repurpose this to feed in other notification tokens in the shared database implementation. What I've done so far is to create 3 separate database managers:
It would seem as though this PR assumes you'll either use public OR private as it forces you to only use one database. What I've done is created 3 different databaseManagers that all live in parallel. The issue becomes when the realm receives a new SyncObject via user action (adding a dog or cat for instance), the notification token stored in each database manager would fire and the new object would be added to all 3 remote databases which is undesirable. So the question is, what is the expected logic where the notificationToken would not be set? How do we get to that point? AFAIK this is always set when we |
Hi @rodericj , actually the situation where notificationToken would not be set will not be happen. So the code could be optimized to the following:
Though I haven't got deep into shared database, I thought shared database is a special private database. So
this issue could be a little tough to handle. As in the current version of IceCream, we suggest using syncing data in the same scope of database per |
Re #58