-
Notifications
You must be signed in to change notification settings - Fork 165
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
Assigning a mixed property with a collection should replace instead of merge #7809
Comments
➤ PM Bot commented: Jira ticket: RCORE-2168 |
➤ dianaafanador3 commented: This branch https://github.com/realm/realm-core/tree/dp/clear-before-assign-collections-in-mixed fixes the issue but I don't know the implications of sending a clear instructions even if the collection is empty in other uses cases |
➤ danieltabacaru commented: I find the title a bit misleading. What I think we want to do is the SDKs to clear the list before inserting the elements and core to replicate the clear instruction. |
Yeah, to clarify, the request here is that Core unconditionally replicates the clear instruction, even if the collection is empty. Then SDKs can implement the replace semantics for collections in mixed. |
The current API for setting a mixed field in all SDKs should behave as a replace, even if the server is capable of merging lists. This is because SDKs only expose assignment operations - i.e. after:
users would expect
var bar = foo.mixed
matches what they assigned to it, not something merged. We haven't designed an API that would allow merging, but if we did, it would look differently and be more explicit about the expected outcome - like:At the moment this test is failing
Even though we clear the collection before assigning to it, this is because the clear instruction is not been sent to the server.
The text was updated successfully, but these errors were encountered: