-
Notifications
You must be signed in to change notification settings - Fork 171
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
Allow embedded objects with asymmetric sync #5566
Allow embedded objects with asymmetric sync #5566
Conversation
test/object-store/sync/flx_sync.cpp
Outdated
CppContext c(realm); | ||
Object::create( | ||
c, realm, "Asymmetric", | ||
util::Any(AnyDict{{"_id", ObjectId::gen()}, {"embedded_obj", AnyDict{{"value", std::string{"foo"}}}}})); |
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.
I know this will exercise the create/set link codepaths, but can we add a test here that updates the embedded field to null and then to a new embedded field as well?
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.
sure. I'll add that
}); | ||
|
||
harness.do_with_new_realm([&](SharedRealm realm) { | ||
wait_for_download(*realm); |
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.
since there aren't any subscriptions here, isn't this a no-op?
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.
correct. But it's just to make sure that if for example the server would do something weird, we don't get any objects.
@jedelbo , can you take a look as well? |
src/realm/obj.cpp
Outdated
get_table()->check_column(col_key); | ||
ColKey::Idx col_ndx = col_key.get_index(); | ||
ColumnType type = col_key.get_type(); | ||
if (type != col_type_Link) | ||
throw LogicError(LogicError::illegal_type); | ||
TableRef target_table = get_target_table(col_key); | ||
Table& t = *target_table; | ||
// Outgoing links from asymmetric objects are disallowed. |
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.
Perhaps "Only embedded objects are allowed"
2e796bf
to
974b390
Compare
What, How & Why?
Embedded objects were wrongly not allowed in asymmetric sync. This PR addresses that.
Fixes #5565.
☑️ ToDos
[ ] C-API, if public C++ API changed.